From 467d653efbb2ca270176ed060e37f2642fa9faae Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sat, 29 Sep 2018 16:01:37 -0400 Subject: [PATCH] Bump up test frameworks used in scripted tests This is in part to test these on JDK 11 by bumping tests to Scala 2.12.7. --- project/Dependencies.scala | 4 +-- project/NightlyPlugin.scala | 2 +- .../cached-resolution-interproj/multi.sbt | 9 ++++-- .../cross-conflict/build.sbt | 5 ---- .../changes/no-conflict-error.sbt | 1 - .../dependency-management/cross-conflict/test | 5 ---- sbt/src/sbt-test/run/fork-loader/build.sbt | 7 +++-- .../sbt-test/tests/arguments-new/build.sbt | 14 --------- .../src/test/scala/ArgumentTest.scala | 14 --------- sbt/src/sbt-test/tests/arguments-new/test | 26 ---------------- sbt/src/sbt-test/tests/arguments/build.sbt | 5 ++-- .../sbt-test/tests/do-not-discover/build.sbt | 10 +++++-- sbt/src/sbt-test/tests/done/build.sbt | 10 +++++-- sbt/src/sbt-test/tests/fork-async/build.sbt | 10 +++---- .../sbt-test/tests/fork-parallel/build.sbt | 6 ++-- .../tests/fork-test-group-parallel/build.sbt | 8 +++-- .../sbt-test/tests/fork-uncaught/build.sbt | 12 -------- .../fork-uncaught/src/main/scala/Foo.scala | 3 -- .../src/test/scala/FooTest.scala | 15 ---------- sbt/src/sbt-test/tests/fork-uncaught/test | 3 -- .../sbt-test/tests/fork-uncaught2/build.sbt | 2 +- sbt/src/sbt-test/tests/fork/build.sbt | 14 +++++---- .../tests/fork/src/test/scala/Ensemble.scala | 5 ++-- sbt/src/sbt-test/tests/fork2/build.sbt | 8 +++-- .../sbt-test/tests/fork2/changes/Test.scala | 7 ++--- sbt/src/sbt-test/tests/it/build.sbt | 17 ++++++----- .../sbt-test/tests/junit-xml-report/build.sbt | 10 +++++-- .../tests/nested-inproc-par/build.sbt | 13 ++++---- .../tests/nested-inproc-seq/build.sbt | 13 ++++---- .../sbt-test/tests/nested-subproc/build.sbt | 17 ++++++----- sbt/src/sbt-test/tests/nested-tests/build.sbt | 12 ++++---- .../tests/one-class-multi-framework/build.sbt | 11 ++++--- sbt/src/sbt-test/tests/order/build.sbt | 7 +++-- sbt/src/sbt-test/tests/resources/build.sbt | 5 ++-- .../scala-instance-classloader/build.sbt | 14 +++++---- sbt/src/sbt-test/tests/serial/build.sbt | 30 ++++++++++--------- sbt/src/sbt-test/tests/setup-cleanup/base.sbt | 5 ++-- .../src/test/scala/CheckSetupCleanup.scala | 8 ++--- .../sbt-test/tests/single-runner/build.sbt | 9 +++--- sbt/src/sbt-test/tests/specs-run/build.sbt | 6 ++-- sbt/src/sbt-test/tests/t543/build.sbt | 10 +++---- sbt/src/sbt-test/tests/task/build.sbt | 9 +++--- sbt/src/sbt-test/tests/test-exclude/build.sbt | 12 ++++---- .../test-exclude/src/test/scala/Test.scala | 5 ++-- sbt/src/sbt-test/tests/test-quick/build.sbt | 16 +++++----- sbt/src/server-test/handshake/build.sbt | 3 +- 46 files changed, 189 insertions(+), 248 deletions(-) delete mode 100644 sbt/src/sbt-test/dependency-management/cross-conflict/build.sbt delete mode 100644 sbt/src/sbt-test/dependency-management/cross-conflict/changes/no-conflict-error.sbt delete mode 100644 sbt/src/sbt-test/dependency-management/cross-conflict/test delete mode 100644 sbt/src/sbt-test/tests/arguments-new/build.sbt delete mode 100644 sbt/src/sbt-test/tests/arguments-new/src/test/scala/ArgumentTest.scala delete mode 100644 sbt/src/sbt-test/tests/arguments-new/test delete mode 100644 sbt/src/sbt-test/tests/fork-uncaught/build.sbt delete mode 100644 sbt/src/sbt-test/tests/fork-uncaught/src/main/scala/Foo.scala delete mode 100644 sbt/src/sbt-test/tests/fork-uncaught/src/test/scala/FooTest.scala delete mode 100644 sbt/src/sbt-test/tests/fork-uncaught/test diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 43128851a..99179eab1 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -99,8 +99,8 @@ object Dependencies { } val jline = "jline" % "jline" % "2.14.6" - val scalatest = "org.scalatest" %% "scalatest" % "3.0.4" - val scalaCheck = "org.scalacheck" %% "scalacheck" % "1.13.4" + val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" + val scalacheck = "org.scalacheck" %% "scalacheck" % "1.14.0" val specs2 = "org.specs2" %% "specs2-junit" % "4.0.1" val junit = "junit" % "junit" % "4.11" val templateResolverApi = "org.scala-sbt" % "template-resolver" % "0.1" diff --git a/project/NightlyPlugin.scala b/project/NightlyPlugin.scala index bc5b24b26..e2d132ba6 100644 --- a/project/NightlyPlugin.scala +++ b/project/NightlyPlugin.scala @@ -11,7 +11,7 @@ object NightlyPlugin extends AutoPlugin { def testDependencies = libraryDependencies ++= ( if (includeTestDependencies.value) - Seq(scalaCheck % Test, specs2 % Test, junit % Test, scalatest % Test) + Seq(scalacheck % Test, specs2 % Test, junit % Test, scalatest % Test) else Seq() ) } diff --git a/sbt/src/sbt-test/dependency-management/cached-resolution-interproj/multi.sbt b/sbt/src/sbt-test/dependency-management/cached-resolution-interproj/multi.sbt index f359cfc76..bfdadea9a 100644 --- a/sbt/src/sbt-test/dependency-management/cached-resolution-interproj/multi.sbt +++ b/sbt/src/sbt-test/dependency-management/cached-resolution-interproj/multi.sbt @@ -1,24 +1,27 @@ // https://github.com/sbt/sbt/issues/1730 lazy val check = taskKey[Unit]("Runs the check") +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" +val junit = "junit" % "junit" % "4.11" + +ThisBuild / scalaVersion := "2.12.7" def commonSettings: Seq[Def.Setting[_]] = Seq( ivyPaths := IvyPaths( (baseDirectory in ThisBuild).value, Some((baseDirectory in LocalRootProject).value / "ivy-cache")), dependencyCacheDirectory := (baseDirectory in LocalRootProject).value / "dependency", - scalaVersion := "2.11.4", resolvers += Resolver.sonatypeRepo("snapshots") ) lazy val transitiveTest = project. settings( commonSettings, - libraryDependencies += "junit" % "junit" % "4.11" % Test + libraryDependencies += junit % Test ) lazy val transitiveTestDefault = project. settings( commonSettings, - libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.1" + libraryDependencies += scalatest ) lazy val a = project. diff --git a/sbt/src/sbt-test/dependency-management/cross-conflict/build.sbt b/sbt/src/sbt-test/dependency-management/cross-conflict/build.sbt deleted file mode 100644 index 2e19d296a..000000000 --- a/sbt/src/sbt-test/dependency-management/cross-conflict/build.sbt +++ /dev/null @@ -1,5 +0,0 @@ -scalaVersion := "2.10.6" -libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % "1.9.1" % "test", - "org.scalamock" %% "scalamock-scalatest-support" % "3.0" % "test" -) diff --git a/sbt/src/sbt-test/dependency-management/cross-conflict/changes/no-conflict-error.sbt b/sbt/src/sbt-test/dependency-management/cross-conflict/changes/no-conflict-error.sbt deleted file mode 100644 index 8ebdf0f5e..000000000 --- a/sbt/src/sbt-test/dependency-management/cross-conflict/changes/no-conflict-error.sbt +++ /dev/null @@ -1 +0,0 @@ -conflictWarning ~= { _.copy(failOnConflict = false) } diff --git a/sbt/src/sbt-test/dependency-management/cross-conflict/test b/sbt/src/sbt-test/dependency-management/cross-conflict/test deleted file mode 100644 index 23768a9a5..000000000 --- a/sbt/src/sbt-test/dependency-management/cross-conflict/test +++ /dev/null @@ -1,5 +0,0 @@ --> update -$ copy-file changes/no-conflict-error.sbt no-conflict-error.sbt - -> reload -> update diff --git a/sbt/src/sbt-test/run/fork-loader/build.sbt b/sbt/src/sbt-test/run/fork-loader/build.sbt index 7cc4c62d5..6dddbe9ec 100644 --- a/sbt/src/sbt-test/run/fork-loader/build.sbt +++ b/sbt/src/sbt-test/run/fork-loader/build.sbt @@ -1,7 +1,10 @@ +val scalcheck = "org.scalacheck" %% "scalacheck" % "1.14.0" + +ThisBuild / scalaVersion := "2.12.7" + lazy val root = (project in file(".")) .settings( - scalaVersion in ThisBuild := "2.11.8", name := "forked-test", organization := "org.example", - libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.10.0" % Test + libraryDependencies += scalcheck % Test ) diff --git a/sbt/src/sbt-test/tests/arguments-new/build.sbt b/sbt/src/sbt-test/tests/arguments-new/build.sbt deleted file mode 100644 index e1037fbda..000000000 --- a/sbt/src/sbt-test/tests/arguments-new/build.sbt +++ /dev/null @@ -1,14 +0,0 @@ -scalaVersion := "2.10.6" -libraryDependencies += "org.scalatest" % "scalatest_2.10" % "2.0.M6-SNAP28" % "test" - - -testOptions in Configurations.Test ++= { - def args(path: String, args: String*): Seq[TestOption] = if(file(path).exists) Tests.Argument(args : _*) :: Nil else Nil -// - args("success1", "-n", "test2 test3") ++ - args("success2", "-n", "test2") ++ - args("success3", "-n", "test3") ++ - args("failure1", "-n", "test1") ++ - args("failure2", "-n", "test1 test4") ++ - args("failure3", "-n", "test1 test3") -} \ No newline at end of file diff --git a/sbt/src/sbt-test/tests/arguments-new/src/test/scala/ArgumentTest.scala b/sbt/src/sbt-test/tests/arguments-new/src/test/scala/ArgumentTest.scala deleted file mode 100644 index 155c6a7e3..000000000 --- a/sbt/src/sbt-test/tests/arguments-new/src/test/scala/ArgumentTest.scala +++ /dev/null @@ -1,14 +0,0 @@ - -import org.scalatest.fixture.FunSuite -import org.scalatest.Tag - -class ArgumentTest extends FunSuite{ - type FixtureParam = Map[String,Any] - override def withFixture(test: OneArgTest) = { - test(test.configMap) - } - test("1", Tag("test1")){ conf => sys.error("error #1") } - test("2", Tag("test2")){ conf => () } - test("3", Tag("test3")){ conf => () } - test("4", Tag("test4")){ conf => sys.error("error #4") } -} \ No newline at end of file diff --git a/sbt/src/sbt-test/tests/arguments-new/test b/sbt/src/sbt-test/tests/arguments-new/test deleted file mode 100644 index c410396aa..000000000 --- a/sbt/src/sbt-test/tests/arguments-new/test +++ /dev/null @@ -1,26 +0,0 @@ -# should fail because it should run all test:tests, some of which are expected to fail (1 and 4) --> test:test - -$ touch success1 -> test:test -$ delete success1 - -$ touch failure1 --> test:test -$ delete failure1 - -$ touch success2 -> test:test -$ delete success2 - -$ touch failure2 --> test:test -$ delete failure2 - -$ touch success3 -> test:test -$ delete success3 - -$ touch failure3 --> test:test -$ delete failure3 \ No newline at end of file diff --git a/sbt/src/sbt-test/tests/arguments/build.sbt b/sbt/src/sbt-test/tests/arguments/build.sbt index 18128aaac..87fe357f8 100644 --- a/sbt/src/sbt-test/tests/arguments/build.sbt +++ b/sbt/src/sbt-test/tests/arguments/build.sbt @@ -1,8 +1,9 @@ -val scalatest = "org.scalatest" %% "scalatest" % "3.0.1" +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" + +ThisBuild / scalaVersion := "2.12.7" lazy val root = (project in file(".")) .settings( - scalaVersion in ThisBuild := "2.11.8", libraryDependencies += scalatest % Test, // testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-f", "result.txt", "-eNDXEHLO") testOptions in Configurations.Test ++= { diff --git a/sbt/src/sbt-test/tests/do-not-discover/build.sbt b/sbt/src/sbt-test/tests/do-not-discover/build.sbt index c6097a06c..0f7475f10 100644 --- a/sbt/src/sbt-test/tests/do-not-discover/build.sbt +++ b/sbt/src/sbt-test/tests/do-not-discover/build.sbt @@ -1,5 +1,9 @@ -scalaVersion := "2.10.6" +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" -libraryDependencies += "org.scalatest" %% "scalatest" % "2.0.M6-SNAP28" +ThisBuild / scalaVersion := "2.12.7" -testOptions in Test += Tests.Argument("-r", "custom.CustomReporter") +lazy val root = (project in file(".")) + .settings( + libraryDependencies += scalatest, + Test / testOptions += Tests.Argument("-C", "custom.CustomReporter") + ) diff --git a/sbt/src/sbt-test/tests/done/build.sbt b/sbt/src/sbt-test/tests/done/build.sbt index c6097a06c..0f7475f10 100644 --- a/sbt/src/sbt-test/tests/done/build.sbt +++ b/sbt/src/sbt-test/tests/done/build.sbt @@ -1,5 +1,9 @@ -scalaVersion := "2.10.6" +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" -libraryDependencies += "org.scalatest" %% "scalatest" % "2.0.M6-SNAP28" +ThisBuild / scalaVersion := "2.12.7" -testOptions in Test += Tests.Argument("-r", "custom.CustomReporter") +lazy val root = (project in file(".")) + .settings( + libraryDependencies += scalatest, + Test / testOptions += Tests.Argument("-C", "custom.CustomReporter") + ) diff --git a/sbt/src/sbt-test/tests/fork-async/build.sbt b/sbt/src/sbt-test/tests/fork-async/build.sbt index 3ddfca63c..874ece230 100644 --- a/sbt/src/sbt-test/tests/fork-async/build.sbt +++ b/sbt/src/sbt-test/tests/fork-async/build.sbt @@ -1,8 +1,8 @@ -testFrameworks += new TestFramework("utest.runner.Framework") +ThisBuild / scalaVersion := "2.12.7" -lazy val root = (project in file(".")). - settings( - scalaVersion := "2.12.6", +lazy val root = (project in file(".")) + .settings( libraryDependencies += "com.lihaoyi" %% "utest" % "0.6.4" % Test, - fork in Test := true + testFrameworks += new TestFramework("utest.runner.Framework"), + Test / fork := true ) diff --git a/sbt/src/sbt-test/tests/fork-parallel/build.sbt b/sbt/src/sbt-test/tests/fork-parallel/build.sbt index 0647f55e9..86de36835 100644 --- a/sbt/src/sbt-test/tests/fork-parallel/build.sbt +++ b/sbt/src/sbt-test/tests/fork-parallel/build.sbt @@ -1,11 +1,11 @@ import Tests._ import Defaults._ +ThisBuild / scalaVersion := "2.12.7" val check = taskKey[Unit]("Check that tests are executed in parallel") -lazy val root = (project in file(".")). - settings( - scalaVersion := "2.11.8", +lazy val root = (project in file(".")) + .settings( libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test, fork in Test := true, check := { diff --git a/sbt/src/sbt-test/tests/fork-test-group-parallel/build.sbt b/sbt/src/sbt-test/tests/fork-test-group-parallel/build.sbt index 761d141ee..496658d48 100644 --- a/sbt/src/sbt-test/tests/fork-test-group-parallel/build.sbt +++ b/sbt/src/sbt-test/tests/fork-test-group-parallel/build.sbt @@ -1,6 +1,8 @@ -scalaVersion in ThisBuild := "2.11.8" -concurrentRestrictions in Global := Seq(Tags.limitAll(4)) -libraryDependencies += "org.specs2" %% "specs2-core" % "3.8.4" % Test +val specs = "org.specs2" %% "specs2-core" % "4.3.4" +ThisBuild / scalaVersion := "2.12.7" + +Global / concurrentRestrictions := Seq(Tags.limitAll(4)) +libraryDependencies += specs % Test inConfig(Test)(Seq( testGrouping := { val home = javaHome.value diff --git a/sbt/src/sbt-test/tests/fork-uncaught/build.sbt b/sbt/src/sbt-test/tests/fork-uncaught/build.sbt deleted file mode 100644 index dd42de86e..000000000 --- a/sbt/src/sbt-test/tests/fork-uncaught/build.sbt +++ /dev/null @@ -1,12 +0,0 @@ -scalaVersion := "2.11.8" - -organization := "org.example" - -name := "fork-uncaught" - -fork := true - -libraryDependencies ++= List( - "org.scala-lang.modules" %% "scala-xml" % "1.0.1", - "org.scalatest" %% "scalatest" % "2.2.6" % Test intransitive() -) diff --git a/sbt/src/sbt-test/tests/fork-uncaught/src/main/scala/Foo.scala b/sbt/src/sbt-test/tests/fork-uncaught/src/main/scala/Foo.scala deleted file mode 100644 index 6904c903f..000000000 --- a/sbt/src/sbt-test/tests/fork-uncaught/src/main/scala/Foo.scala +++ /dev/null @@ -1,3 +0,0 @@ -package foo.test - -object Foo { val foo = 5 } \ No newline at end of file diff --git a/sbt/src/sbt-test/tests/fork-uncaught/src/test/scala/FooTest.scala b/sbt/src/sbt-test/tests/fork-uncaught/src/test/scala/FooTest.scala deleted file mode 100644 index 838ea44c4..000000000 --- a/sbt/src/sbt-test/tests/fork-uncaught/src/test/scala/FooTest.scala +++ /dev/null @@ -1,15 +0,0 @@ -package foo.test - -import org.scalatest.{FunSpec, ShouldMatchers} - -class FooTest extends FunSpec with ShouldMatchers { - - if(java.lang.Boolean.getBoolean("test.init.fail")) - sys.error("exception during construction") - - describe("Foo.foo should") { - it("always return 5") { - Foo.foo should equal (5) - } - } -} diff --git a/sbt/src/sbt-test/tests/fork-uncaught/test b/sbt/src/sbt-test/tests/fork-uncaught/test deleted file mode 100644 index 0f38f68bc..000000000 --- a/sbt/src/sbt-test/tests/fork-uncaught/test +++ /dev/null @@ -1,3 +0,0 @@ -> test -> 'set javaOptions in Test += "-Dtest.init.fail=true"' --> test diff --git a/sbt/src/sbt-test/tests/fork-uncaught2/build.sbt b/sbt/src/sbt-test/tests/fork-uncaught2/build.sbt index b1fcc9ee4..bef8cff4b 100644 --- a/sbt/src/sbt-test/tests/fork-uncaught2/build.sbt +++ b/sbt/src/sbt-test/tests/fork-uncaught2/build.sbt @@ -1,4 +1,4 @@ -scalaVersion := "2.11.8" +ThisBuild / scalaVersion := "2.12.7" libraryDependencies += "org.scala-sbt" % "test-interface" % "1.0" diff --git a/sbt/src/sbt-test/tests/fork/build.sbt b/sbt/src/sbt-test/tests/fork/build.sbt index cb68da8a6..56e972825 100644 --- a/sbt/src/sbt-test/tests/fork/build.sbt +++ b/sbt/src/sbt-test/tests/fork/build.sbt @@ -5,13 +5,17 @@ val groupSize = 3 val groups = 3 val check = TaskKey[Unit]("check", "Check all files were created and remove them.") +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" +val scalaxml = "org.scala-lang.modules" %% "scala-xml" % "1.1.1" def groupId(idx: Int) = "group_" + (idx + 1) def groupPrefix(idx: Int) = groupId(idx) + "_file_" -lazy val root = (project in file(".")). - settings( - scalaVersion := "2.11.8", +ThisBuild / scalaVersion := "2.12.7" +ThisBuild / organization := "org.example" + +lazy val root = (project in file(".")) + .settings( testGrouping in Test := { val tests = (definedTests in Test).value assert(tests.size == 3) @@ -33,7 +37,7 @@ lazy val root = (project in file(".")). }, concurrentRestrictions := Tags.limit(Tags.ForkedTestGroup, 2) :: Nil, libraryDependencies ++= List( - "org.scala-lang.modules" %% "scala-xml" % "1.0.1", - "org.scalatest" %% "scalatest" % "2.2.6" % Test + scalaxml, + scalatest % Test ) ) diff --git a/sbt/src/sbt-test/tests/fork/src/test/scala/Ensemble.scala b/sbt/src/sbt-test/tests/fork/src/test/scala/Ensemble.scala index 6d1d152d7..9dbd69cb7 100644 --- a/sbt/src/sbt-test/tests/fork/src/test/scala/Ensemble.scala +++ b/sbt/src/sbt-test/tests/fork/src/test/scala/Ensemble.scala @@ -1,12 +1,11 @@ import org.scalatest.FlatSpec -import org.scalatest.matchers.MustMatchers import java.io.File -trait Ensemble extends FlatSpec with MustMatchers { +trait Ensemble extends FlatSpec { def i: Int def prefix = System.getProperty("group.prefix") - "an ensemble" must "create all files" in { + "an ensemble" should "create all files" in { val f = new File(prefix + i) f.createNewFile } diff --git a/sbt/src/sbt-test/tests/fork2/build.sbt b/sbt/src/sbt-test/tests/fork2/build.sbt index 3156665b5..c52a432ed 100644 --- a/sbt/src/sbt-test/tests/fork2/build.sbt +++ b/sbt/src/sbt-test/tests/fork2/build.sbt @@ -1,4 +1,6 @@ -scalaVersion := "2.10.6" -fork := true +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" -libraryDependencies += "org.scalatest" %% "scalatest" % "1.9" % "test" +ThisBuild / scalaVersion := "2.12.7" + +fork := true +libraryDependencies += scalatest % Test diff --git a/sbt/src/sbt-test/tests/fork2/changes/Test.scala b/sbt/src/sbt-test/tests/fork2/changes/Test.scala index f0ecc32bb..6706da71f 100644 --- a/sbt/src/sbt-test/tests/fork2/changes/Test.scala +++ b/sbt/src/sbt-test/tests/fork2/changes/Test.scala @@ -1,9 +1,8 @@ import org.scalatest.FlatSpec -import org.scalatest.matchers.MustMatchers -class Test extends FlatSpec with MustMatchers { +class Test extends FlatSpec { val v = Option(System.getenv("tests.max.value")) getOrElse Int.MaxValue - "A simple equation" must "hold" in { - Int.MaxValue must equal (v) + "A simple equation" should "hold" in { + assert(Int.MaxValue == v) } } diff --git a/sbt/src/sbt-test/tests/it/build.sbt b/sbt/src/sbt-test/tests/it/build.sbt index 421d8c032..d207ede26 100644 --- a/sbt/src/sbt-test/tests/it/build.sbt +++ b/sbt/src/sbt-test/tests/it/build.sbt @@ -1,9 +1,10 @@ -lazy val root = (project in file(".")). - configs(IntegrationTest). - settings( - scalaVersion := "2.10.6", - Defaults.itSettings, - libraryDependencies += specs - ) +ThisBuild / scalaVersion := "2.12.7" -lazy val specs = "org.specs2" % "specs2_2.10" % "1.12.3" % IntegrationTest +val specs = "org.specs2" %% "specs2-core" % "4.3.4" + +lazy val root = (project in file(".")) + .configs(IntegrationTest) + .settings( + Defaults.itSettings, + libraryDependencies += specs % IntegrationTest + ) diff --git a/sbt/src/sbt-test/tests/junit-xml-report/build.sbt b/sbt/src/sbt-test/tests/junit-xml-report/build.sbt index d944b9aa4..d07114d0b 100644 --- a/sbt/src/sbt-test/tests/junit-xml-report/build.sbt +++ b/sbt/src/sbt-test/tests/junit-xml-report/build.sbt @@ -11,11 +11,15 @@ val failingReportFile = "target/test-reports/another.pkg.FailingTest.xml" val flatSuiteReportFile = "target/test-reports/my.scalatest.MyFlatSuite.xml" val nestedSuitesReportFile = "target/test-reports/my.scalatest.MyNestedSuites.xml" +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" +val junitinterface = "com.novocode" % "junit-interface" % "0.11" + +ThisBuild / scalaVersion := "2.12.7" + lazy val root = (project in file(".")). settings( - scalaVersion := "2.11.8", - libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test, - libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.6" % Test, + libraryDependencies += junitinterface % Test, + libraryDependencies += scalatest % Test, // TODO use matchers instead of sys.error checkReport := { val oneSecondReport = XML.loadFile(oneSecondReportFile) diff --git a/sbt/src/sbt-test/tests/nested-inproc-par/build.sbt b/sbt/src/sbt-test/tests/nested-inproc-par/build.sbt index a6b9aba9a..444e1a0c3 100644 --- a/sbt/src/sbt-test/tests/nested-inproc-par/build.sbt +++ b/sbt/src/sbt-test/tests/nested-inproc-par/build.sbt @@ -1,7 +1,10 @@ -scalaVersion := "2.10.6" +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" -libraryDependencies += "org.scalatest" %% "scalatest" % "2.0.M6-SNAP28" +ThisBuild / scalaVersion := "2.12.7" -testOptions in Test += Tests.Argument("-r", "custom.CustomReporter") - -parallelExecution in Test := true +lazy val root = (project in file(".")) + .settings( + libraryDependencies += scalatest, + Test / testOptions += Tests.Argument("-C", "custom.CustomReporter"), + Test / parallelExecution := true + ) diff --git a/sbt/src/sbt-test/tests/nested-inproc-seq/build.sbt b/sbt/src/sbt-test/tests/nested-inproc-seq/build.sbt index 85610ee5d..ec66daefa 100644 --- a/sbt/src/sbt-test/tests/nested-inproc-seq/build.sbt +++ b/sbt/src/sbt-test/tests/nested-inproc-seq/build.sbt @@ -1,7 +1,10 @@ -scalaVersion := "2.10.6" +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" -libraryDependencies += "org.scalatest" %% "scalatest" % "2.0.M6-SNAP28" +ThisBuild / scalaVersion := "2.12.7" -testOptions in Test += Tests.Argument("-r", "custom.CustomReporter") - -parallelExecution in Test := false +lazy val root = (project in file(".")) + .settings( + libraryDependencies += scalatest, + Test / testOptions += Tests.Argument("-C", "custom.CustomReporter"), + Test / parallelExecution := false + ) diff --git a/sbt/src/sbt-test/tests/nested-subproc/build.sbt b/sbt/src/sbt-test/tests/nested-subproc/build.sbt index 3302653bd..7073b0e16 100644 --- a/sbt/src/sbt-test/tests/nested-subproc/build.sbt +++ b/sbt/src/sbt-test/tests/nested-subproc/build.sbt @@ -1,10 +1,11 @@ -lazy val root = (project in file(".")). - settings( - scalaVersion := "2.11.8", - libraryDependencies ++= List( - "org.scala-lang.modules" %% "scala-xml" % "1.0.1", - "org.scalatest" %% "scalatest" % "2.2.6" - ), - testOptions in Test += Tests.Argument("-r", "custom.CustomReporter"), +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" +val scalaxml = "org.scala-lang.modules" %% "scala-xml" % "1.1.1" + +ThisBuild / scalaVersion := "2.12.7" + +lazy val root = (project in file(".")) + .settings( + libraryDependencies ++= List(scalatest, scalaxml), + Test / testOptions += Tests.Argument("-C", "custom.CustomReporter"), fork := true ) diff --git a/sbt/src/sbt-test/tests/nested-tests/build.sbt b/sbt/src/sbt-test/tests/nested-tests/build.sbt index 2e47706f6..be9f855e4 100644 --- a/sbt/src/sbt-test/tests/nested-tests/build.sbt +++ b/sbt/src/sbt-test/tests/nested-tests/build.sbt @@ -1,8 +1,8 @@ -libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.13.5" % "test" +val scalcheck = "org.scalacheck" %% "scalacheck" % "1.14.0" -version := "0.0.1" +ThisBuild / scalaVersion := "2.12.7" +ThisBuild / version := "0.0.1" +ThisBuild / organization := "org.catastrophe" + +libraryDependencies += scalcheck % Test name := "broken" -organization := "org.catastrophe" -//scalaVersion := "2.10.6" -scalaVersion := "2.12.3" - diff --git a/sbt/src/sbt-test/tests/one-class-multi-framework/build.sbt b/sbt/src/sbt-test/tests/one-class-multi-framework/build.sbt index 80a62d3ce..e228eabc8 100644 --- a/sbt/src/sbt-test/tests/one-class-multi-framework/build.sbt +++ b/sbt/src/sbt-test/tests/one-class-multi-framework/build.sbt @@ -1,6 +1,5 @@ -scalaVersion := "2.10.2" - -libraryDependencies += "com.novocode" % "junit-interface" % "0.10-M4" % "test" - -libraryDependencies += "org.specs2" %% "specs2" % "2.1.1" % "test" - +val specsJunit = "org.specs2" %% "specs2-junit" % "4.3.4" +val junitinterface = "com.novocode" % "junit-interface" % "0.11" +ThisBuild / scalaVersion := "2.12.7" +libraryDependencies += junitinterface % Test +libraryDependencies += specsJunit % Test diff --git a/sbt/src/sbt-test/tests/order/build.sbt b/sbt/src/sbt-test/tests/order/build.sbt index 48f571f7c..c79d85fd3 100644 --- a/sbt/src/sbt-test/tests/order/build.sbt +++ b/sbt/src/sbt-test/tests/order/build.sbt @@ -1,4 +1,5 @@ -scalaVersion in ThisBuild := "2.11.8" -parallelExecution in Test := false -libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.10.0" % Test +val scalcheck = "org.scalacheck" %% "scalacheck" % "1.14.0" +ThisBuild / scalaVersion := "2.12.7" +Test / parallelExecution := false +libraryDependencies += scalcheck % Test diff --git a/sbt/src/sbt-test/tests/resources/build.sbt b/sbt/src/sbt-test/tests/resources/build.sbt index 7905ed044..426a0eb79 100644 --- a/sbt/src/sbt-test/tests/resources/build.sbt +++ b/sbt/src/sbt-test/tests/resources/build.sbt @@ -1,2 +1,3 @@ -scalaVersion := "2.10.6" -libraryDependencies += "org.specs2" % "specs2_2.10" % "1.12.3" % "test" +val specs = "org.specs2" %% "specs2-core" % "4.3.4" +ThisBuild / scalaVersion := "2.12.7" +libraryDependencies += specs % Test diff --git a/sbt/src/sbt-test/tests/scala-instance-classloader/build.sbt b/sbt/src/sbt-test/tests/scala-instance-classloader/build.sbt index 3aae8a6a7..3de42341b 100644 --- a/sbt/src/sbt-test/tests/scala-instance-classloader/build.sbt +++ b/sbt/src/sbt-test/tests/scala-instance-classloader/build.sbt @@ -1,12 +1,16 @@ import sbt.internal.inc.ScalaInstance lazy val OtherScala = config("other-scala").hide +lazy val junitinterface = "com.novocode" % "junit-interface" % "0.11" +lazy val akkaActor = "com.typesafe.akka" %% "akka-actor" % "2.5.17" +ThisBuild / scalaVersion := "2.12.7" lazy val root = (project in file(".")) .configs(OtherScala) .settings( - scalaVersion := "2.11.11", - libraryDependencies += "org.scala-lang" % "scala-compiler" % "2.11.11" % OtherScala.name, + libraryDependencies += { + "org.scala-lang" % "scala-compiler" % scalaVersion.value % OtherScala.name + }, managedClasspath in OtherScala := Classpaths.managedJars(OtherScala, classpathTypes.value, update.value), // Hack in the scala instance @@ -14,7 +18,7 @@ lazy val root = (project in file(".")) val rawJars = (managedClasspath in OtherScala).value.map(_.data) val scalaHome = (target.value / "scala-home") def removeVersion(name: String): String = - name.replaceAll("\\-2.11.11", "") + name.replaceAll("\\-2.12.7", "") for(jar <- rawJars) { val tjar = scalaHome / s"lib/${removeVersion(jar.getName)}" IO.copyFile(jar, tjar) @@ -23,8 +27,8 @@ lazy val root = (project in file(".")) ScalaInstance(scalaHome, appConfiguration.value.provider.scalaProvider.launcher) }, - libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test, - libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.3.3" % Test, + libraryDependencies += junitinterface % Test, + libraryDependencies += akkaActor % Test, scalaModuleInfo := { val old = scalaModuleInfo.value diff --git a/sbt/src/sbt-test/tests/serial/build.sbt b/sbt/src/sbt-test/tests/serial/build.sbt index 92523f098..0590da98d 100644 --- a/sbt/src/sbt-test/tests/serial/build.sbt +++ b/sbt/src/sbt-test/tests/serial/build.sbt @@ -1,27 +1,29 @@ +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" + +ThisBuild / scalaVersion := "2.12.7" +ThisBuild / organization := "com.example" +ThisBuild / version := "0.0.1-SNAPSHOT" + val commonSettings = Seq( - libraryDependencies += "org.scalatest" %% "scalatest" % "1.9.1" % Test + libraryDependencies += scalatest % Test ) -lazy val root = (project in file(".")). - aggregate(sub1, sub2). - settings(inThisBuild(List( - organization := "com.example", - version := "0.0.1-SNAPSHOT", - scalaVersion := "2.10.6" - )), +lazy val root = (project in file(".")) + .aggregate(sub1, sub2) + .settings( commonSettings ) lazy val rootRef = LocalProject("root") -lazy val sub1 = project. - dependsOn(rootRef). - settings( +lazy val sub1 = project + .dependsOn(rootRef) + .settings( commonSettings ) -lazy val sub2 = project. - dependsOn(rootRef). - settings( +lazy val sub2 = project + .dependsOn(rootRef) + .settings( commonSettings ) diff --git a/sbt/src/sbt-test/tests/setup-cleanup/base.sbt b/sbt/src/sbt-test/tests/setup-cleanup/base.sbt index 0afca122e..cbd451549 100644 --- a/sbt/src/sbt-test/tests/setup-cleanup/base.sbt +++ b/sbt/src/sbt-test/tests/setup-cleanup/base.sbt @@ -1,2 +1,3 @@ -scalaVersion := "2.10.6" -libraryDependencies += "org.scalatest" %% "scalatest" % "1.9.1" +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" +ThisBuild / scalaVersion := "2.12.7" +libraryDependencies += scalatest diff --git a/sbt/src/sbt-test/tests/setup-cleanup/src/test/scala/CheckSetupCleanup.scala b/sbt/src/sbt-test/tests/setup-cleanup/src/test/scala/CheckSetupCleanup.scala index 054d6019b..5a4b72a7d 100644 --- a/sbt/src/sbt-test/tests/setup-cleanup/src/test/scala/CheckSetupCleanup.scala +++ b/sbt/src/sbt-test/tests/setup-cleanup/src/test/scala/CheckSetupCleanup.scala @@ -1,17 +1,15 @@ import org.scalatest.FlatSpec -import org.scalatest.matchers.MustMatchers import java.io.File -class CheckSetupCleanup extends FlatSpec with MustMatchers -{ +class CheckSetupCleanup extends FlatSpec { val f = new File("setup") - "setup file" must "exist" in { + "setup file" should "exist" in { assert(f.exists, "Setup file didn't exist: " + f.getAbsolutePath) f.delete() } val t = new File("tested") - "cleanup file" must "not exist" in { + "cleanup file" should "not exist" in { assert(!t.exists, "Cleanup file already existed: " + t.getAbsolutePath) t.createNewFile() } diff --git a/sbt/src/sbt-test/tests/single-runner/build.sbt b/sbt/src/sbt-test/tests/single-runner/build.sbt index c6097a06c..6d47ccec9 100644 --- a/sbt/src/sbt-test/tests/single-runner/build.sbt +++ b/sbt/src/sbt-test/tests/single-runner/build.sbt @@ -1,5 +1,4 @@ -scalaVersion := "2.10.6" - -libraryDependencies += "org.scalatest" %% "scalatest" % "2.0.M6-SNAP28" - -testOptions in Test += Tests.Argument("-r", "custom.CustomReporter") +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" +ThisBuild / scalaVersion := "2.12.7" +libraryDependencies += scalatest +Test / testOptions += Tests.Argument("-C", "custom.CustomReporter") diff --git a/sbt/src/sbt-test/tests/specs-run/build.sbt b/sbt/src/sbt-test/tests/specs-run/build.sbt index c9f3e0f04..597f082a6 100644 --- a/sbt/src/sbt-test/tests/specs-run/build.sbt +++ b/sbt/src/sbt-test/tests/specs-run/build.sbt @@ -1,4 +1,4 @@ -lazy val specs2 = "org.specs2" %% "specs2" % "2.3.11" -scalaVersion := "2.11.8" +val specs = "org.specs2" %% "specs2-core" % "4.3.4" +ThisBuild / scalaVersion := "2.12.7" -libraryDependencies += specs2 % Test +libraryDependencies += specs % Test diff --git a/sbt/src/sbt-test/tests/t543/build.sbt b/sbt/src/sbt-test/tests/t543/build.sbt index fa93b01ee..b276006e1 100644 --- a/sbt/src/sbt-test/tests/t543/build.sbt +++ b/sbt/src/sbt-test/tests/t543/build.sbt @@ -4,14 +4,14 @@ import java.io.{ CharArrayWriter, PrintWriter } val marker = new File("marker") val check = TaskKey[Unit]("check", "Check correct error has been returned.") +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" +val scalaxml = "org.scala-lang.modules" %% "scala-xml" % "1.1.1" + +ThisBuild / scalaVersion := "2.12.7" lazy val root = (project in file(".")). settings( - libraryDependencies ++= List( - "org.scala-lang.modules" %% "scala-xml" % "1.0.1", - "org.scalatest" %% "scalatest" % "2.2.6" - ), - scalaVersion := "2.11.8", + libraryDependencies ++= List(scalaxml, scalatest), fork := true, testListeners += new TestReportListener { def testEvent(event: TestEvent): Unit = { diff --git a/sbt/src/sbt-test/tests/task/build.sbt b/sbt/src/sbt-test/tests/task/build.sbt index c6097a06c..6d47ccec9 100644 --- a/sbt/src/sbt-test/tests/task/build.sbt +++ b/sbt/src/sbt-test/tests/task/build.sbt @@ -1,5 +1,4 @@ -scalaVersion := "2.10.6" - -libraryDependencies += "org.scalatest" %% "scalatest" % "2.0.M6-SNAP28" - -testOptions in Test += Tests.Argument("-r", "custom.CustomReporter") +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" +ThisBuild / scalaVersion := "2.12.7" +libraryDependencies += scalatest +Test / testOptions += Tests.Argument("-C", "custom.CustomReporter") diff --git a/sbt/src/sbt-test/tests/test-exclude/build.sbt b/sbt/src/sbt-test/tests/test-exclude/build.sbt index 3d05c8130..fea325e11 100644 --- a/sbt/src/sbt-test/tests/test-exclude/build.sbt +++ b/sbt/src/sbt-test/tests/test-exclude/build.sbt @@ -1,6 +1,8 @@ -lazy val root = (project in file(".")). - settings( - scalaVersion := "2.10.6", - libraryDependencies += "org.scalatest" %% "scalatest" % "1.9.1" % Test, - parallelExecution in test := false +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" +ThisBuild / scalaVersion := "2.12.7" + +lazy val root = (project in file(".")) + .settings( + libraryDependencies += scalatest % Test, + Test / parallelExecution := false ) diff --git a/sbt/src/sbt-test/tests/test-exclude/src/test/scala/Test.scala b/sbt/src/sbt-test/tests/test-exclude/src/test/scala/Test.scala index c7b0235e2..f23b47fba 100644 --- a/sbt/src/sbt-test/tests/test-exclude/src/test/scala/Test.scala +++ b/sbt/src/sbt-test/tests/test-exclude/src/test/scala/Test.scala @@ -1,14 +1,13 @@ import java.io.File import org.scalatest.FlatSpec -import org.scalatest.matchers.ShouldMatchers -class Test1 extends FlatSpec with ShouldMatchers { +class Test1 extends FlatSpec { "a test" should "pass" in { new File("target/Test1.run").createNewFile() } } -class Test2 extends FlatSpec with ShouldMatchers { +class Test2 extends FlatSpec { "a test" should "pass" in { new File("target/Test2.run").createNewFile() } diff --git a/sbt/src/sbt-test/tests/test-quick/build.sbt b/sbt/src/sbt-test/tests/test-quick/build.sbt index 8efb08911..cfa01bd02 100644 --- a/sbt/src/sbt-test/tests/test-quick/build.sbt +++ b/sbt/src/sbt-test/tests/test-quick/build.sbt @@ -1,9 +1,9 @@ -lazy val root = (project in file(".")). - settings( - scalaVersion := "2.11.8", - libraryDependencies ++= List( - "org.scala-lang.modules" %% "scala-xml" % "1.0.1", - "org.scalatest" %% "scalatest" % "2.2.6" - ), - parallelExecution in test := false +val scalatest = "org.scalatest" %% "scalatest" % "3.0.5" +val scalaxml = "org.scala-lang.modules" %% "scala-xml" % "1.1.1" +ThisBuild / scalaVersion := "2.12.7" + +lazy val root = (project in file(".")) + .settings( + libraryDependencies ++= List(scalaxml, scalatest), + Test / parallelExecution := false ) diff --git a/sbt/src/server-test/handshake/build.sbt b/sbt/src/server-test/handshake/build.sbt index 02f5f81fd..98058040d 100644 --- a/sbt/src/server-test/handshake/build.sbt +++ b/sbt/src/server-test/handshake/build.sbt @@ -1,5 +1,7 @@ import sbt.internal.server.{ ServerHandler, ServerIntent } +ThisBuild / scalaVersion := "2.12.7" + lazy val root = (project in file(".")) .settings( Global / serverLog / logLevel := Level.Debug, @@ -20,5 +22,4 @@ lazy val root = (project in file(".")) }), name := "handshake", - scalaVersion := "2.12.3", )