Class NullnessNullMarkedOnlyAnnotatedForTest

java.lang.Object
org.checkerframework.framework.test.CheckerFrameworkPerDirectoryTest
org.checkerframework.checker.test.junit.NullnessNullMarkedOnlyAnnotatedForTest

public class NullnessNullMarkedOnlyAnnotatedForTest extends CheckerFrameworkPerDirectoryTest
JUnit tests for the Nullness Checker's treatment of JSpecify's @NullMarked as an alias for @AnnotatedFor("nullness"). This is separate from NullnessNullMarkedTest because -AonlyAnnotatedFor suppresses every error outside an @AnnotatedFor scope, which would make the tests in that class vacuous.
  • Constructor Details

    • NullnessNullMarkedOnlyAnnotatedForTest

      public NullnessNullMarkedOnlyAnnotatedForTest(List<File> testFiles)
      Create a NullnessNullMarkedOnlyAnnotatedForTest.
      Parameters:
      testFiles - the files containing test code, which will be type-checked
  • Method Details

    • getTestDirs

      public static String[] getTestDirs()
      This method returns the directories containing test code. Each directory will be type-checked with -AonlyAnnotatedFor.
      Returns:
      the directories containing test code
    • run

      public void run()
      Description copied from class: CheckerFrameworkPerDirectoryTest
      Run the tests.
      Overrides:
      run in class CheckerFrameworkPerDirectoryTest
    • resolveTestDirectory

      protected File resolveTestDirectory()
      Resolves the test root directory from the optional TestRootDirectory annotation or falls back to the default of currentDir/tests.
      Returns:
      the resolved directory
    • checkResult

      public void checkResult(TypecheckResult typecheckResult)
      Check that the TypecheckResult did not fail.
      Parameters:
      typecheckResult - result to check