Search in sources :

Example 1 with TestSelector

use of fr.inria.diversify.dspot.selector.TestSelector in project dspot by STAMP-project.

the class JSAPOptions method parse.

public static Configuration parse(String[] args) {
    JSAPResult jsapConfig = options.parse(args);
    Main.verbose = jsapConfig.getBoolean("verbose");
    if (!jsapConfig.success() || jsapConfig.getBoolean("help")) {
        System.err.println();
        for (Iterator<?> errs = jsapConfig.getErrorMessageIterator(); errs.hasNext(); ) {
            System.err.println("Error: " + errs.next());
        }
        showUsage();
    } else if (jsapConfig.getBoolean("example")) {
        return null;
    }
    if (jsapConfig.getString("path") == null) {
        System.err.println("Error: Parameter 'path' is required.");
        showUsage();
    }
    TestSelector testCriterion;
    if (jsapConfig.getString("mutant") != null) {
        if (!"PitMutantScoreSelector".equals(jsapConfig.getString("test-criterion"))) {
            LOGGER.warn("You specify a path to mutations.csv but you did not specified the right test-criterion");
            LOGGER.warn("Forcing the Selector to PitMutantScoreSelector");
        }
        testCriterion = new PitMutantScoreSelector(jsapConfig.getString("mutant"));
    } else {
        testCriterion = SelectorEnum.valueOf(jsapConfig.getString("test-criterion")).buildSelector();
    }
    PitMutantScoreSelector.descartesMode = jsapConfig.getBoolean("descartes");
    TestRunnerFactory.useReflectiveTestRunner = false;
    DSpotUtils.withComment = jsapConfig.getBoolean("comment");
    return new Configuration(jsapConfig.getString("path"), buildAmplifiersFromString(jsapConfig.getStringArray("amplifiers")), jsapConfig.getInt("iteration"), Arrays.asList(jsapConfig.getStringArray("test")), jsapConfig.getString("output"), testCriterion, Arrays.asList(jsapConfig.getStringArray("testCases")), jsapConfig.getLong("seed"), jsapConfig.getInt("timeOut"), jsapConfig.getString("builder"), jsapConfig.getString("mavenHome"), jsapConfig.getInt("maxTestAmplified"), jsapConfig.getBoolean("clean"), !jsapConfig.getBoolean("no-minimize"));
}
Also used : PitMutantScoreSelector(fr.inria.diversify.dspot.selector.PitMutantScoreSelector) TestSelector(fr.inria.diversify.dspot.selector.TestSelector)

Aggregations

PitMutantScoreSelector (fr.inria.diversify.dspot.selector.PitMutantScoreSelector)1 TestSelector (fr.inria.diversify.dspot.selector.TestSelector)1