Mark passing pending scripted tests as failures

This commit is contained in:
Martin Duhem 2015-08-18 15:38:36 +02:00
parent ca1de3836e
commit 1b2750be7a
1 changed files with 8 additions and 0 deletions

View File

@ -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."
}