public class AinferValidatePerDirectoryTest extends CheckerFrameworkWPIPerDirectoryTest
CheckerFrameworkPerDirectoryTest
for testing the Whole Program
Inference feature of the Checker Framework, which is tested by running pairs of these tests: a
"generation test" (of class AinferGeneratePerDirectoryTest
) to do inference using the
-Ainfer
option, and a "validation test" (of this class) to check that files typecheck
after those inferences are taken into account.checkerNames, checkerOptions, classpathExtra, testDir, testFiles
Modifier | Constructor and Description |
---|---|
protected |
AinferValidatePerDirectoryTest(List<File> testFiles,
Class<? extends AbstractProcessor> checker,
String checkerShortName,
String testDir,
Class<? extends AinferGeneratePerDirectoryTest> generationTest,
String... checkerOptions)
Creates a new checker test.
|
Modifier and Type | Method and Description |
---|---|
protected static String |
ajavaArgFromFiles(List<File> sourceFiles,
String checkerShortName)
Computes the -Aajava argument that corresponds to the test files.
|
protected static String |
astubsArgFromFiles(List<File> sourceFiles,
String checkerShortName)
Computes the -Astubs argument that corresponds to the test files.
|
void |
run() |
doNotTypecheck
adjustTypecheckResult, customizeOptions
protected AinferValidatePerDirectoryTest(List<File> testFiles, Class<? extends AbstractProcessor> checker, String checkerShortName, String testDir, Class<? extends AinferGeneratePerDirectoryTest> generationTest, 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 usecheckerShortName
- the short name of the checker, as used in the naming conventions for
files, e.g. "index" for the Index Checker or "testchecker" for the AInferTestCheckertestDir
- the path to the directory of test inputsgenerationTest
- the class of the test that must run before this test, if this is the
second of a pair of testscheckerOptions
- options to pass to the compiler when running testsprotected static String ajavaArgFromFiles(List<File> sourceFiles, String checkerShortName)
Assumes that ajava files will be in the #getInferenceBaseDir(String)
directory.
sourceFiles
- the list of source filescheckerShortName
- the short name of the checker, as used in the naming conventions for
files, e.g. "index" for the Index Checker or "testchecker" for the AInferTestCheckerprotected static String astubsArgFromFiles(List<File> sourceFiles, String checkerShortName)
Assumes that astub files will be in the #getInferenceBaseDir(String)
directory.
sourceFiles
- the list of source filescheckerShortName
- the short name of the checker, as used in the naming conventions for
files, e.g. "index" for the Index Checker or "testchecker" for the AInferTestCheckerpublic void run()
run
in class CheckerFrameworkPerDirectoryTest