Class NullnessBinaryStubDiffTest
java.lang.Object
org.checkerframework.framework.test.CheckerFrameworkPerDirectoryTest
org.checkerframework.checker.test.junit.NullnessBinaryStubDiffTest
Differential test for the binary stub format: verifies that loading the annotated JDK from
annotated-jdk.bin.gz and the built-in checker stub files from their .astub.bin.gz forms
(via BinaryStubReader) produces exactly the same annotations as parsing the text stubs
(via AnnotationFileParser), for every class in each binary stub.
The -AbinaryStubDiffCheck option makes AnnotationFileElementTypes run
BinaryStubDiffChecker at initialization, which reports each disagreement between the two paths
as an error; this test expects no diagnostics. A failure here means BinaryStubWriter or
BinaryStubReader diverges from the text parser's semantics for some construct in the
stubs — the binary path would silently drop or alter annotations for every user.
The Nullness Checker is used as the host checker because it exercises four annotated type factories and the largest set of JDK annotations. The JDK check runs once per compilation; built-in stub files are checked by each stub-types factory that loads them.
-
Field Summary
Fields inherited from class org.checkerframework.framework.test.CheckerFrameworkPerDirectoryTest
checkerNames, checkerOptions, classpathExtra, testDir, testFiles -
Constructor Summary
ConstructorsConstructorDescriptionNullnessBinaryStubDiffTest(List<File> testFiles) Create a NullnessBinaryStubDiffTest. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckResult(TypecheckResult typecheckResult) Check that theTypecheckResultdid not fail.static String[]Returns the test directories.protected FileResolves the test root directory from the optionalTestRootDirectoryannotation or falls back to the default ofcurrentDir/tests.Methods inherited from class org.checkerframework.framework.test.CheckerFrameworkPerDirectoryTest
adjustTypecheckResult, customizeOptions, run
-
Constructor Details
-
NullnessBinaryStubDiffTest
Create a NullnessBinaryStubDiffTest.- Parameters:
testFiles- the files containing test code, which will be type-checked
-
-
Method Details
-
getTestDirs
Returns the test directories.- Returns:
- the test directories
-
resolveTestDirectory
Resolves the test root directory from the optionalTestRootDirectoryannotation or falls back to the default ofcurrentDir/tests.- Returns:
- the resolved directory
-
checkResult
Check that theTypecheckResultdid not fail.- Parameters:
typecheckResult- result to check
-