run tests from cmdline (#2132)

* run tests

* include junit in jar

* tabs spaces
This commit is contained in:
Matthew Kennedy 2020-12-24 17:12:43 -08:00 committed by GitHub
parent afbcfa964a
commit 57d696e809
2 changed files with 25 additions and 3 deletions

View File

@ -1,5 +1,8 @@
package com.rusefi;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
/**
* dead?
*
@ -16,6 +19,27 @@ package com.rusefi;
public class RealHardwareTestLauncher {
public static void main(String[] args) throws InterruptedException {
JUnitCore junit = new JUnitCore();
Result result = junit.run(
FunctionalTest.class,
PwmHardwareTest.class,
VssHardwareLoopTest.class,
HighRevTest.class
);
// Print a summary of tests run
System.out.println("Ran " + result.getRunCount() + " tests total.");
System.out.println("Ignored " + result.getIgnoreCount() + " tests.");
System.out.println("Failed " + result.getFailureCount() + " tests.");
result.getFailures().forEach(f -> {
System.out.println(f.toString());
System.out.println("Test failed: " + f.getTestHeader() + " because " + f.getMessage());
System.out.println("Exception:");
f.getException().printStackTrace();
});
}
/**

View File

@ -173,6 +173,7 @@
<zipfileset src="lib/batik/batik-util.jar" includes="**/*.class"/>
<zipfileset src="lib/jlatexmath-1.0.6.jar" includes="**/*.class **/*.xml **/*.ttf"/>
<zipfileset src="lib/json-simple-1.1.1.jar" includes="**/*.class"/>
<zipfileset src="lib/junit.jar" includes="**/*.class"/>
</jar>
</target>
@ -187,9 +188,6 @@
</target>
<target name="real_hardware_functional_test" depends="jar">
<java classpath="${jar_file}" classname="com.rusefi.RealHardwareTestLauncher" failonerror="true">
</java>
<mkdir dir="${hw_tests}"/>
<junit fork="no"
maxmemory="512m"