diff --git a/pitest/src/main/java/org/pitest/coverage/execute/CoverageTestExecutionListener.java b/pitest/src/main/java/org/pitest/coverage/execute/CoverageTestExecutionListener.java index ad0f70c7c..7cac35bc4 100644 --- a/pitest/src/main/java/org/pitest/coverage/execute/CoverageTestExecutionListener.java +++ b/pitest/src/main/java/org/pitest/coverage/execute/CoverageTestExecutionListener.java @@ -10,6 +10,7 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicLong; +import java.util.logging.Level; import java.util.logging.Logger; import static java.util.concurrent.TimeUnit.NANOSECONDS; @@ -42,7 +43,12 @@ public void executionStarted(Description description, boolean suppressParallelWa } @Override - public void executionFinished(Description description, boolean passed) { + public void executionFinished(Description description, boolean passed, Throwable maybeError) { + + if (maybeError != null) { + LOG.log(Level.SEVERE, description.toString(), maybeError); + } + Long t0 = startTimes.remove(description); int executionTime; if (t0 == null) { @@ -70,4 +76,5 @@ public void executionFinished(Description description, boolean passed) { invokeQueue.recordTestOutcome(description, passed, executionTime); } + } diff --git a/pitest/src/main/java/org/pitest/testapi/NullExecutionListener.java b/pitest/src/main/java/org/pitest/testapi/NullExecutionListener.java index 0d97f74c0..f9f04d1a0 100644 --- a/pitest/src/main/java/org/pitest/testapi/NullExecutionListener.java +++ b/pitest/src/main/java/org/pitest/testapi/NullExecutionListener.java @@ -7,7 +7,7 @@ public void executionStarted(Description description) { } @Override - public void executionFinished(Description description, boolean passed) { + public void executionFinished(Description description, boolean passed, Throwable error) { //noop } } diff --git a/pitest/src/main/java/org/pitest/testapi/TestUnitExecutionListener.java b/pitest/src/main/java/org/pitest/testapi/TestUnitExecutionListener.java index 3529329f4..97680db1b 100644 --- a/pitest/src/main/java/org/pitest/testapi/TestUnitExecutionListener.java +++ b/pitest/src/main/java/org/pitest/testapi/TestUnitExecutionListener.java @@ -20,5 +20,10 @@ default void executionStarted(Description description) { default void executionStarted(Description description, boolean suppressParallelWarning) { executionStarted(description); } - void executionFinished(Description description, boolean passed); + + default void executionFinished(Description description, boolean passed) { + executionFinished(description, passed, null); + } + + void executionFinished(Description description, boolean passed, Throwable error); }