From 1b2750be7a9d3a389a264b95c45a4ceaab3d0a34 Mon Sep 17 00:00:00 2001 From: Martin Duhem Date: Tue, 18 Aug 2015 15:38:36 +0200 Subject: [PATCH] Mark passing pending scripted tests as failures --- scripted/sbt/src/main/scala/sbt/test/ScriptedTests.scala | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripted/sbt/src/main/scala/sbt/test/ScriptedTests.scala b/scripted/sbt/src/main/scala/sbt/test/ScriptedTests.scala index 6e5dc8f38..764ad7916 100644 --- a/scripted/sbt/src/main/scala/sbt/test/ScriptedTests.scala +++ b/scripted/sbt/src/main/scala/sbt/test/ScriptedTests.scala @@ -81,6 +81,7 @@ final class ScriptedTests(resourceBaseDirectory: File, bufferLog: Boolean, launc prescripted(testDirectory) runTest() buffered.info("+ " + label + pendingString) + if (pending) throw new PendingTestSuccessException(label) } catch { case e: xsbt.test.TestException => testFailed() @@ -89,6 +90,9 @@ final class ScriptedTests(resourceBaseDirectory: File, bufferLog: Boolean, launc case _ => e.printStackTrace } if (!pending) throw e + case e: PendingTestSuccessException => + testFailed() + throw e case e: Exception => testFailed() if (!pending) throw e @@ -209,3 +213,7 @@ object CompatibilityLevel extends Enumeration { case Minimal28 => "2.8.1" } } +class PendingTestSuccessException(label: String) extends Exception { + override def getMessage: String = + s"The pending test $label succeeded. Mark this test as passing to remove this failure." +}