public class TestConfigurationBuilder extends Object
new TestConfigurationBuilder() .addOption("-Awarns") .addSourceFile("src1.java")
.addDiagnosticFile("src1.out")
TestConfiguration
Modifier and Type | Field and Description |
---|---|
static String |
TESTS_OUTPUTDIR |
Constructor and Description |
---|
TestConfigurationBuilder()
Note: There are static helper methods named buildConfiguration and buildConfigurationBuilder
that can be used to create the most common types of configurations
|
TestConfigurationBuilder(TestConfiguration initialConfig)
Create a builder that has all of the optoins in initialConfig
|
public static final String TESTS_OUTPUTDIR
public TestConfigurationBuilder()
public TestConfigurationBuilder(TestConfiguration initialConfig)
public static TestConfigurationBuilder getDefaultConfigurationBuilder(String testSourcePath, File outputClassDirectory, String classPath, Iterable<File> testSourceFiles, Iterable<String> processors, List<String> options, boolean shouldEmitDebugInfo)
testSourcePath
- the path to the Checker test file sources, usually this is the
directory of Checker's testsoutputClassDirectory
- the directory to place classes compiled for testingclassPath
- the classpath to use for compilationtestSourceFiles
- the Java files that compose the testprocessors
- the checkers or other annotation processors to run over the testSourceFilesoptions
- the options to the compiler/processorsshouldEmitDebugInfo
- whether or not debug information should be emittedpublic static TestConfiguration buildDefaultConfiguration(String testSourcePath, Iterable<File> testSourceFiles, Iterable<String> processors, List<String> options, boolean shouldEmitDebugInfo)
testSourcePath
- the path to the Checker test file sources, usually this is the
directory of Checker's teststestSourceFiles
- the Java files that compose the testprocessors
- the checkers or other annotation processors to run over the testSourceFilesoptions
- the options to the compiler/processorsshouldEmitDebugInfo
- whether or not debug information should be emittedpublic static TestConfiguration buildDefaultConfiguration(String testSourcePath, File testFile, String checkerName, List<String> options, boolean shouldEmitDebugInfo)
testSourcePath
- the path to the Checker test file sources, usually this is the
directory of Checker's teststestFile
- a single test java file to compilecheckerName
- a single Checker to include in the processors fieldoptions
- the options to the compiler/processorsshouldEmitDebugInfo
- whether or not debug information should be emittedpublic List<String> validate(boolean requireProcessors)
-processor
option in the optionMap (it should be added by
addProcessor instead)
requireProcessors
- whether or not to require that there is at least one processorpublic TestConfigurationBuilder adddToPathOption(String key, String toAppend)
public TestConfigurationBuilder addDiagnosticFile(File diagnostics)
public TestConfigurationBuilder addDiagnosticFiles(Iterable<File> diagnostics)
public TestConfigurationBuilder setDiagnosticFiles(List<File> diagnosticFiles)
public TestConfigurationBuilder addSourceFile(File sourceFile)
public TestConfigurationBuilder addSourceFiles(Iterable<File> sourceFiles)
public TestConfigurationBuilder setSourceFiles(List<File> sourceFiles)
public TestConfigurationBuilder setOptions(Map<String,String> options)
public TestConfigurationBuilder addOption(String option)
public TestConfigurationBuilder addOption(String option, String value)
public TestConfigurationBuilder addOptionIfValueNonEmpty(String option, String value)
public TestConfigurationBuilder addOptions(Map<String,String> options)
public TestConfigurationBuilder addOptions(Iterable<String> newOptions)
public TestConfigurationBuilder setProcessors(Iterable<String> processors)
public TestConfigurationBuilder addProcessor(String processor)
public TestConfigurationBuilder addProcessors(Iterable<String> processors)
public TestConfigurationBuilder emitDebugInfo()
public TestConfigurationBuilder dontEmitDebugInfo()
public TestConfigurationBuilder setShouldEmitDebugInfo(boolean shouldEmitDebugInfo)
public TestConfiguration build()
public TestConfiguration validateThenBuild(boolean requireProcessors)
requireProcessors
- whether or not there should be at least 1 processor specified, see
method validatepublic static File getOutputDirFromProperty()
public static String getDefaultClassPath()
public static String getJdkJarPathFromProperty()