Class CheckerFrameworkPerDirectoryTest

java.lang.Object
org.checkerframework.framework.test.CheckerFrameworkPerDirectoryTest
Direct Known Subclasses:
CheckerFrameworkWPIPerDirectoryTest

public abstract class CheckerFrameworkPerDirectoryTest extends Object
Compiles all test files in a test directory together. Use 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:

  1. Declare a constructor taking 1 parameter of type java.util.List<java.io.File>. This is a list of the files that will be compiled.
  2. Declare the following method:
    @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"};
   }
 }
 
  • Field Details

    • testFiles

      protected final List<File> testFiles
      The files containing test code, which will be type-checked.
    • checkerNames

      protected final List<@BinaryName String> checkerNames
      The binary names of the checkers to run.
    • testDir

      protected final String testDir
      The path, relative to currentDir/test to the directory containing test inputs.
    • checkerOptions

      protected final List<String> checkerOptions
      Extra options to pass to javac when running the checker.
    • classpathExtra

      protected final List<String> classpathExtra
      Extra entries for the classpath.
  • Constructor Details

  • Method Details