public abstract class CheckerFrameworkPerDirectoryTest extends Object
CheckerFrameworkPerFileTest to
 compile each test file in a test directory individually. A CheckerFrameworkPerDirectoryTest is faster than an equivalent CheckerFrameworkPerFileTest, but can only test that processor errors or warnings are issued.
 To create a CheckerFrameworkPerDirectoryTest, create a new class that extends this
 class. The new class must do the following:
 
java.util.List<java.io.File>. This
       is a list of the files that will be compiled.
    @Parameters public static String [] getTestDirs()
       getTestDir must return an array of directories that exist in the test folder. The directories can contain more path information (e.g., "myTestDir/moreTests") but note, the test suite will find all of the Java test files that exists below the listed directories. It is unnecessary to list child directories of a directory you have already listed.
 public class MyTest extends CheckerFrameworkPerDirectoryTest {
   /**  @param testFiles the files containing test code, which will be type-checked * /
   public MyTest(List <File > testFiles) {
     super(testFiles, MyChecker.class, "", "Anomsgtext");
   }
   @Parameters
   public static String [] getTestDirs() {
     return new String[]{"all-systems"};
   }
 }
 | Modifier and Type | Field and Description | 
|---|---|
protected List<String> | 
checkerNames
The binary names of the checkers to run. 
 | 
protected List<String> | 
checkerOptions
Extra options to pass to javac when running the checker. 
 | 
protected List<String> | 
classpathExtra
Extra entries for the classpath. 
 | 
protected String | 
testDir
The path, relative to currentDir/test to the directory containing test inputs. 
 | 
protected List<File> | 
testFiles
The files containing test code, which will be type-checked. 
 | 
| Modifier | Constructor and Description | 
|---|---|
protected  | 
CheckerFrameworkPerDirectoryTest(List<File> testFiles,
                                Class<? extends AbstractProcessor> checker,
                                String testDir,
                                List<String> classpathExtra,
                                String... checkerOptions)
Creates a new checker test. 
 | 
protected  | 
CheckerFrameworkPerDirectoryTest(List<File> testFiles,
                                Class<? extends AbstractProcessor> checker,
                                String testDir,
                                String... checkerOptions)
Creates a new checker test. 
 | 
protected  | 
CheckerFrameworkPerDirectoryTest(List<File> testFiles,
                                List<String> checkerNames,
                                String testDir,
                                List<String> classpathExtra,
                                String... checkerOptions)
Creates a new checker test. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
TypecheckResult | 
adjustTypecheckResult(TypecheckResult testResult)
This method is called before issuing assertions about a TypecheckResult. 
 | 
List<String> | 
customizeOptions(List<String> previousOptions)
Override this method if you would like to supply a checker command-line option that depends on
 the Java files passed to the test. 
 | 
void | 
run()  | 
protected final List<File> testFiles
protected final String testDir
protected final List<String> checkerOptions
protected CheckerFrameworkPerDirectoryTest(List<File> testFiles, Class<? extends AbstractProcessor> checker, String testDir, String... checkerOptions)
TestConfigurationBuilder.getDefaultConfigurationBuilder(String, File, String,
 Iterable, Iterable, List, boolean) adds additional checker options.
testFiles - the files containing test code, which will be type-checkedchecker - the class for the checker to usetestDir - the path to the directory of test inputscheckerOptions - options to pass to the compiler when running testsprotected CheckerFrameworkPerDirectoryTest(List<File> testFiles, Class<? extends AbstractProcessor> checker, String testDir, List<String> classpathExtra, String... checkerOptions)
TestConfigurationBuilder.getDefaultConfigurationBuilder(String, File, String,
 Iterable, Iterable, List, boolean) adds additional checker options.
testFiles - the files containing test code, which will be type-checkedchecker - the class for the checker to usetestDir - the path to the directory of test inputsclasspathExtra - extra entries for the classpath, relative to a directory such as
     checker-framework/checkercheckerOptions - options to pass to the compiler when running testsprotected CheckerFrameworkPerDirectoryTest(List<File> testFiles, List<String> checkerNames, String testDir, List<String> classpathExtra, String... checkerOptions)
TestConfigurationBuilder.getDefaultConfigurationBuilder(String, File, String,
 Iterable, Iterable, List, boolean) adds additional checker options.
testFiles - the files containing test code, which will be type-checkedcheckerNames - the binary names of the checkers to runtestDir - the path to the directory of test inputsclasspathExtra - extra entries for the classpath, relative to a directory such as
     checker-framework/checkercheckerOptions - options to pass to the compiler when running testspublic void run()
public TypecheckResult adjustTypecheckResult(TypecheckResult testResult)
testResult - a test result to possibly changepublic List<String> customizeOptions(List<String> previousOptions)
testFiles.
 If you want to specify the same command-line option for all tests of a particular checker,
 then pass it to the CheckerFrameworkPerDirectoryTest(java.util.List<java.io.File>, java.util.List<java.lang.String>, java.lang.String, java.util.List<java.lang.String>, java.lang.String...) constructor.
previousOptions - the options specified in the constructor of the test previousOptions is
     unmodifiable