From 6e83ba5603f2b80f325cdbaf4ed89da206e6ae77 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Mon, 16 Dec 2019 22:26:13 -0500 Subject: [PATCH] Reproduce #5308 #5308 --- sbt/src/sbt-test/tests/scalatest/build.sbt | 12 ++++++++++++ .../scalatest/src/test/scala/example/HelloSpec.scala | 9 +++++++++ sbt/src/sbt-test/tests/scalatest/test | 1 + .../main/scala/sbt/scriptedtest/ScriptedTests.scala | 3 ++- 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 sbt/src/sbt-test/tests/scalatest/build.sbt create mode 100644 sbt/src/sbt-test/tests/scalatest/src/test/scala/example/HelloSpec.scala create mode 100644 sbt/src/sbt-test/tests/scalatest/test diff --git a/sbt/src/sbt-test/tests/scalatest/build.sbt b/sbt/src/sbt-test/tests/scalatest/build.sbt new file mode 100644 index 000000000..1f501a862 --- /dev/null +++ b/sbt/src/sbt-test/tests/scalatest/build.sbt @@ -0,0 +1,12 @@ +ThisBuild / scalaVersion := "2.13.1" +ThisBuild / version := "0.1.0-SNAPSHOT" +ThisBuild / organization := "com.example" +ThisBuild / organizationName := "example" + +lazy val root = (project in file(".")) + .settings( + name := "sbt-5308", + libraryDependencies += "org.scalatest" %% "scalatest" % "3.1.0" % Test, + libraryDependencies += "com.vladsch.flexmark" % "flexmark-all" % "0.35.10" % Test, + Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-h", "target/generated/test-reports"), + ) diff --git a/sbt/src/sbt-test/tests/scalatest/src/test/scala/example/HelloSpec.scala b/sbt/src/sbt-test/tests/scalatest/src/test/scala/example/HelloSpec.scala new file mode 100644 index 000000000..b1878dee1 --- /dev/null +++ b/sbt/src/sbt-test/tests/scalatest/src/test/scala/example/HelloSpec.scala @@ -0,0 +1,9 @@ +package example + +import org.scalatest._ + +class HelloSpec extends FlatSpec with Matchers { + "hello" should "say hello" in { + assert("hello" == "hello") + } +} diff --git a/sbt/src/sbt-test/tests/scalatest/test b/sbt/src/sbt-test/tests/scalatest/test new file mode 100644 index 000000000..dfffb838b --- /dev/null +++ b/sbt/src/sbt-test/tests/scalatest/test @@ -0,0 +1 @@ +> test diff --git a/scripted-sbt-redux/src/main/scala/sbt/scriptedtest/ScriptedTests.scala b/scripted-sbt-redux/src/main/scala/sbt/scriptedtest/ScriptedTests.scala index 5968d7d8b..f463837f9 100644 --- a/scripted-sbt-redux/src/main/scala/sbt/scriptedtest/ScriptedTests.scala +++ b/scripted-sbt-redux/src/main/scala/sbt/scriptedtest/ScriptedTests.scala @@ -248,7 +248,8 @@ final class ScriptedTests( LauncherBased // there is an issue with jansi and coursier case "watch/commands" => LauncherBased // java.lang.ClassNotFoundException: javax.tools.DiagnosticListener when run with java 11 and an old sbt launcher - case "watch/managed" => LauncherBased // sbt/Package$ + case "watch/managed" => LauncherBased // sbt/Package$ + case "tests/scalatest" => LauncherBased case "tests/test-cross" => LauncherBased // the sbt metabuild classpath leaks into the test interface classloader in older versions of sbt case _ => RunFromSourceBased