diff --git a/project/Scripted.scala b/project/Scripted.scala index 6202e3992..163b3223c 100644 --- a/project/Scripted.scala +++ b/project/Scripted.scala @@ -19,10 +19,11 @@ object Scripted { case class ScriptedTestPage(page: Int, total: Int) def scriptedParser(scriptedBase: File): Parser[Seq[String]] = { - val pairs = (scriptedBase * AllPassFilter * AllPassFilter * "test").get map { (f: File) => + val scriptedFiles: NameFilter = ("test": NameFilter) | "pending" + val pairs = (scriptedBase * AllPassFilter * AllPassFilter * scriptedFiles).get map { (f: File) => val p = f.getParentFile (p.getParentFile.getName, p.getName) - }; + } val pairMap = pairs.groupBy(_._1).mapValues(_.map(_._2).toSet); val id = charClass(c => !c.isWhitespace && c != '/').+.string diff --git a/sbt/src/sbt-test/dependency-management/gh-1484-npe/pending b/sbt/src/sbt-test/dependency-management/gh-1484-npe/test similarity index 100% rename from sbt/src/sbt-test/dependency-management/gh-1484-npe/pending rename to sbt/src/sbt-test/dependency-management/gh-1484-npe/test diff --git a/sbt/src/sbt-test/dependency-management/mvn-local/test b/sbt/src/sbt-test/dependency-management/mvn-local/disabled similarity index 100% rename from sbt/src/sbt-test/dependency-management/mvn-local/test rename to sbt/src/sbt-test/dependency-management/mvn-local/disabled diff --git a/sbt/src/sbt-test/dependency-management/publish-local/pending b/sbt/src/sbt-test/dependency-management/publish-local/disabled similarity index 100% rename from sbt/src/sbt-test/dependency-management/publish-local/pending rename to sbt/src/sbt-test/dependency-management/publish-local/disabled diff --git a/sbt/src/sbt-test/project/session-save/pending b/sbt/src/sbt-test/project/session-save/disabled similarity index 100% rename from sbt/src/sbt-test/project/session-save/pending rename to sbt/src/sbt-test/project/session-save/disabled diff --git a/sbt/src/sbt-test/source-dependencies/implicit-search-companion-scope/pending b/sbt/src/sbt-test/source-dependencies/implicit-search-companion-scope/test similarity index 100% rename from sbt/src/sbt-test/source-dependencies/implicit-search-companion-scope/pending rename to sbt/src/sbt-test/source-dependencies/implicit-search-companion-scope/test diff --git a/sbt/src/sbt-test/source-dependencies/trait-super/pending b/sbt/src/sbt-test/source-dependencies/trait-super/test similarity index 100% rename from sbt/src/sbt-test/source-dependencies/trait-super/pending rename to sbt/src/sbt-test/source-dependencies/trait-super/test diff --git a/sbt/src/sbt-test/tests/arguments-new/pending b/sbt/src/sbt-test/tests/arguments-new/test similarity index 100% rename from sbt/src/sbt-test/tests/arguments-new/pending rename to sbt/src/sbt-test/tests/arguments-new/test diff --git a/scripted/sbt/src/main/scala/sbt/test/ScriptedTests.scala b/scripted/sbt/src/main/scala/sbt/test/ScriptedTests.scala index 6e5dc8f38..d2164dfd6 100644 --- a/scripted/sbt/src/main/scala/sbt/test/ScriptedTests.scala +++ b/scripted/sbt/src/main/scala/sbt/test/ScriptedTests.scala @@ -40,7 +40,7 @@ final class ScriptedTests(resourceBaseDirectory: File, bufferLog: Boolean, launc None } else { try { scriptedTest(str, testDirectory, prescripted, log); None } - catch { case e: xsbt.test.TestException => Some(str) } + catch { case _: xsbt.test.TestException | _: PendingTestSuccessException => Some(str) } } } } @@ -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,10 @@ final class ScriptedTests(resourceBaseDirectory: File, bufferLog: Boolean, launc case _ => e.printStackTrace } if (!pending) throw e + case e: PendingTestSuccessException => + testFailed() + buffered.error(" Mark as passing to remove this failure.") + throw e case e: Exception => testFailed() if (!pending) throw e @@ -209,3 +214,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." +}