Class AinferGeneratePerDirectoryTest
- java.lang.Object
-
- org.checkerframework.framework.test.CheckerFrameworkPerDirectoryTest
-
- org.checkerframework.framework.test.CheckerFrameworkWPIPerDirectoryTest
-
- org.checkerframework.framework.test.AinferGeneratePerDirectoryTest
-
public abstract class AinferGeneratePerDirectoryTest extends CheckerFrameworkWPIPerDirectoryTest
A specialized variant ofCheckerFrameworkPerDirectoryTest
for testing the Whole Program Inference feature of the Checker Framework, which is tested by running pairs of these tests: a "generation test" (of this class) to do inference using the-Ainfer
option, and a "validation test" (of classAinferValidatePerDirectoryTest
) to check that files typecheck after those inferences are taken into account.
-
-
Field Summary
-
Fields inherited from class org.checkerframework.framework.test.CheckerFrameworkPerDirectoryTest
checkerNames, checkerOptions, classpathExtra, testDir, testFiles
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AinferGeneratePerDirectoryTest(java.util.List<java.io.File> testFiles, java.lang.Class<? extends javax.annotation.processing.AbstractProcessor> checker, java.lang.String testDir, java.lang.String... checkerOptions)
Creates a new checker test.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkResult(TypecheckResult typecheckResult)
Check that theTypecheckResult
did not fail.protected java.io.File
resolveTestDirectory()
Resolves the test root directory from the optionalTestRootDirectory
annotation or falls back to the default ofcurrentDir/tests
.-
Methods inherited from class org.checkerframework.framework.test.CheckerFrameworkWPIPerDirectoryTest
doNotTypecheck, hasSkipComment
-
Methods inherited from class org.checkerframework.framework.test.CheckerFrameworkPerDirectoryTest
adjustTypecheckResult, customizeOptions, run
-
-
-
-
Constructor Detail
-
AinferGeneratePerDirectoryTest
protected AinferGeneratePerDirectoryTest(java.util.List<java.io.File> testFiles, java.lang.Class<? extends javax.annotation.processing.AbstractProcessor> checker, java.lang.String testDir, java.lang.String... checkerOptions)
Creates a new checker test. Use this constructor when creating a generation test.TestConfigurationBuilder.getDefaultConfigurationBuilder(String, File, String, Iterable, Iterable, List, boolean)
adds additional checker options.- Parameters:
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 tests
-
-
Method Detail
-
resolveTestDirectory
protected java.io.File resolveTestDirectory()
Resolves the test root directory from the optionalTestRootDirectory
annotation or falls back to the default ofcurrentDir/tests
.- Returns:
- the resolved directory
-
checkResult
public void checkResult(TypecheckResult typecheckResult)
Check that theTypecheckResult
did not fail.- Parameters:
typecheckResult
- result to check
-
-