void (TestResult testResult) { final TestListener testListener = loadDiscoveryListener(); if (testListener != null) { testResult.addListener(testListener); } final OutOfProcessRetries.OutOfProcessRetryListener outOfProcessRetryListener = OutOfProcessRetries.getListenerForOutOfProcessRetry(); if (outOfProcessRetryListener != null) { testResult.addListener(outOfProcessRetryListener); } testResult = RetriesImpl.maybeEnable(testResult); List<Class<?>> classes = myTestCaseLoader.getClasses(); // to make it easier to reproduce order-dependent failures locally System.out.println("------"); System.out.println("Running tests classes:"); for (Class<?> aClass : classes) { System.out.println(aClass.getName()); } System.out.println("------"); int totalTests = classes.size(); for (Class<?> aClass : classes) { runNextTest(testResult, totalTests, aClass); if (testResult.shouldStop()) break; } if (testListener instanceof Closeable) { try { ((Closeable)testListener).close(); } catch (IOException e) { e.printStackTrace(); } } if (outOfProcessRetryListener != null) { try { outOfProcessRetryListener.save(); } catch (IOException e) { e.printStackTrace(); } } TestCaseLoader.sendTestRunResultsToNastradamus(); }