Build: Fix test logger NPE when no tests are run
This commit fixes the test progress logging to not produce an NPE when
there are no tests run. The onQuit method is always called, but onStart
would not be called if no tests match the test patterns.
@@ -100,6 +100,8 @@ class TestProgressLogger implements AggregatedEventListener {
@Subscribe
void onQuit(AggregatedQuitEvent e) throws IOException {
+ // if onStart was never called (eg no matching tests), suiteLogger and all the other loggers will be null
+ if (suiteLogger != null) {
suiteLogger.completed()
testLogger.completed()
for (ProgressLogger slaveLogger : slaveLoggers) {
@@ -107,6 +109,7 @@ class TestProgressLogger implements AggregatedEventListener {
}
parentProgressLogger.completed()
}
+ }
@Subscribe
void onSuiteStart(AggregatedSuiteStartedEvent e) throws IOException {
