use of fr.inria.diversify.dspot.selector.PitMutantScoreSelector 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"));
}
use of fr.inria.diversify.dspot.selector.PitMutantScoreSelector in project dspot by STAMP-project.
the class PitScoreMutantSelectorDescartesTest method testPitDescartesMode.
@Test
public void testPitDescartesMode() throws Exception {
/*
weak contract: this test should not throw any exception and end properly
the increase of the mutation score and the selection is delegated to dedicated test
here we test that the descartes mode runs
*/
assertFalse(PitMutantScoreSelector.descartesMode);
PitMutantScoreSelector.descartesMode = true;
PitMutantScoreSelector.pitVersion = "1.2.0";
InputConfiguration configuration = new InputConfiguration("src/test/resources/test-projects/test-projects.properties");
DSpot dspot = new DSpot(configuration, 1, Arrays.asList(new StringLiteralAmplifier(), new NumberLiteralAmplifier()), new PitMutantScoreSelector());
dspot.amplifyTest("example.TestSuiteExample", Collections.singletonList("test2"));
FileUtils.cleanDirectory(new File(configuration.getOutputDirectory()));
assertTrue(PitMutantScoreSelector.descartesMode);
}
Aggregations