in testsuite/jflex-testsuite-maven-plugin/src/main/java/jflex/maven/plugin/testsuite/JFlexTestsuiteMojo.java [45:82]
public void execute() throws MojoExecutionException, MojoFailureException {
boolean success = true;
File jflexUberJar = new File(jflexUberJarFilename);
try {
System.setOut(new PrintStream(System.out, true));
List<File> files = new ArrayList<>();
getLog().info("JFlex: " + jflexUberJar.getAbsolutePath());
getLog()
.info("Testing version: " + PomUtils.getPomVersion("de.jflex", "jflex", jflexUberJar));
getLog().info("Test directory: " + testDirectory);
getLog().info("Test case(s): " + (null == testcases ? "All" : testcases));
if (testcases != null && testcases.length() > 0) {
for (String testCase : testcases.split("\\s*,\\s*")) {
File dir = new File(testDirectory, testCase.trim());
if (!dir.isDirectory()) {
throw new FileNotFoundException("Test directory is not a directory: " + dir);
}
List<File> t = TestsuiteUtils.scan(dir, ".test", false);
files.addAll(t);
}
}
// if we still didn't find anything, scan the whole test path
if (files.isEmpty()) files = TestsuiteUtils.scan(new File(testDirectory), ".test", true);
TestsuiteUtils.verbose = verbose;
getLog().info("verbose: " + verbose);
success = TestsuiteUtils.runTests(files, jflexUberJar);
} catch (Exception e) {
throw new MojoExecutionException("Failed to execute test suite: " + e.getMessage(), e);
}
if (!success) {
throw new MojoFailureException("Test(s) failed.");
}
}