Search in sources :

Example 1 with LoggingListener

use of org.junit.platform.launcher.listeners.LoggingListener in project narchy by automenta.

the class NARTestBenchmark method junit.

// @Benchmark
// @BenchmarkMode(Mode.AverageTime)
// @Fork(1)
// public void testY() {
// The.Compound.the = FastCompound.FAST_COMPOUND_BUILDER;
// //        Param.SynchronousExecution_Max_CycleTime = 0.0001f;
// 
// junit(testclass);
// }
static void junit(Class... testClasses) {
    LauncherDiscoveryRequest request = LauncherDiscoveryRequestBuilder.request().selectors(// selectPackage("com.example.mytests"),
    (ClassSelector[]) Util.map(DiscoverySelectors::selectClass, new ClassSelector[testClasses.length], testClasses)).build();
    Launcher launcher = LauncherFactory.create();
    // SummaryGeneratingListener listener = new SummaryGeneratingListener();
    LoggingListener listener = LoggingListener.forJavaUtilLogging();
    launcher.registerTestExecutionListeners(listener);
    launcher.execute(request, listener);
// listener.getSummary().printTo(new PrintWriter(System.out));
}
Also used : LauncherDiscoveryRequest(org.junit.platform.launcher.LauncherDiscoveryRequest) ClassSelector(org.junit.platform.engine.discovery.ClassSelector) Launcher(org.junit.platform.launcher.Launcher) LoggingListener(org.junit.platform.launcher.listeners.LoggingListener)

Aggregations

ClassSelector (org.junit.platform.engine.discovery.ClassSelector)1 Launcher (org.junit.platform.launcher.Launcher)1 LauncherDiscoveryRequest (org.junit.platform.launcher.LauncherDiscoveryRequest)1 LoggingListener (org.junit.platform.launcher.listeners.LoggingListener)1