Merge pull request #4392 from eed3si9n/wip/update-test-tests

Bump up test frameworks used in scripted tests
This commit is contained in:
eugene yokota 2018-09-30 00:41:24 -04:00 committed by GitHub
commit 2afff9571b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
46 changed files with 189 additions and 248 deletions

View File

@ -99,8 +99,8 @@ object Dependencies {
} }
val jline = "jline" % "jline" % "2.14.6" val jline = "jline" % "jline" % "2.14.6"
val scalatest = "org.scalatest" %% "scalatest" % "3.0.4" val scalatest = "org.scalatest" %% "scalatest" % "3.0.5"
val scalaCheck = "org.scalacheck" %% "scalacheck" % "1.13.4" val scalacheck = "org.scalacheck" %% "scalacheck" % "1.14.0"
val specs2 = "org.specs2" %% "specs2-junit" % "4.0.1" val specs2 = "org.specs2" %% "specs2-junit" % "4.0.1"
val junit = "junit" % "junit" % "4.11" val junit = "junit" % "junit" % "4.11"
val templateResolverApi = "org.scala-sbt" % "template-resolver" % "0.1" val templateResolverApi = "org.scala-sbt" % "template-resolver" % "0.1"

View File

@ -11,7 +11,7 @@ object NightlyPlugin extends AutoPlugin {
def testDependencies = libraryDependencies ++= ( def testDependencies = libraryDependencies ++= (
if (includeTestDependencies.value) if (includeTestDependencies.value)
Seq(scalaCheck % Test, specs2 % Test, junit % Test, scalatest % Test) Seq(scalacheck % Test, specs2 % Test, junit % Test, scalatest % Test)
else Seq() else Seq()
) )
} }

View File

@ -1,24 +1,27 @@
// https://github.com/sbt/sbt/issues/1730 // https://github.com/sbt/sbt/issues/1730
lazy val check = taskKey[Unit]("Runs the check") 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[_]] = def commonSettings: Seq[Def.Setting[_]] =
Seq( Seq(
ivyPaths := IvyPaths( (baseDirectory in ThisBuild).value, Some((baseDirectory in LocalRootProject).value / "ivy-cache")), ivyPaths := IvyPaths( (baseDirectory in ThisBuild).value, Some((baseDirectory in LocalRootProject).value / "ivy-cache")),
dependencyCacheDirectory := (baseDirectory in LocalRootProject).value / "dependency", dependencyCacheDirectory := (baseDirectory in LocalRootProject).value / "dependency",
scalaVersion := "2.11.4",
resolvers += Resolver.sonatypeRepo("snapshots") resolvers += Resolver.sonatypeRepo("snapshots")
) )
lazy val transitiveTest = project. lazy val transitiveTest = project.
settings( settings(
commonSettings, commonSettings,
libraryDependencies += "junit" % "junit" % "4.11" % Test libraryDependencies += junit % Test
) )
lazy val transitiveTestDefault = project. lazy val transitiveTestDefault = project.
settings( settings(
commonSettings, commonSettings,
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.1" libraryDependencies += scalatest
) )
lazy val a = project. lazy val a = project.

View File

@ -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"
)

View File

@ -1 +0,0 @@
conflictWarning ~= { _.copy(failOnConflict = false) }

View File

@ -1,5 +0,0 @@
-> update
$ copy-file changes/no-conflict-error.sbt no-conflict-error.sbt
> reload
> update

View File

@ -1,7 +1,10 @@
val scalcheck = "org.scalacheck" %% "scalacheck" % "1.14.0"
ThisBuild / scalaVersion := "2.12.7"
lazy val root = (project in file(".")) lazy val root = (project in file("."))
.settings( .settings(
scalaVersion in ThisBuild := "2.11.8",
name := "forked-test", name := "forked-test",
organization := "org.example", organization := "org.example",
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.10.0" % Test libraryDependencies += scalcheck % Test
) )

View File

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

View File

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

View File

@ -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

View File

@ -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(".")) lazy val root = (project in file("."))
.settings( .settings(
scalaVersion in ThisBuild := "2.11.8",
libraryDependencies += scalatest % Test, libraryDependencies += scalatest % Test,
// testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-f", "result.txt", "-eNDXEHLO") // testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-f", "result.txt", "-eNDXEHLO")
testOptions in Configurations.Test ++= { testOptions in Configurations.Test ++= {

View File

@ -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")
)

View File

@ -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")
)

View File

@ -1,8 +1,8 @@
testFrameworks += new TestFramework("utest.runner.Framework") ThisBuild / scalaVersion := "2.12.7"
lazy val root = (project in file(".")). lazy val root = (project in file("."))
settings( .settings(
scalaVersion := "2.12.6",
libraryDependencies += "com.lihaoyi" %% "utest" % "0.6.4" % Test, libraryDependencies += "com.lihaoyi" %% "utest" % "0.6.4" % Test,
fork in Test := true testFrameworks += new TestFramework("utest.runner.Framework"),
Test / fork := true
) )

View File

@ -1,11 +1,11 @@
import Tests._ import Tests._
import Defaults._ import Defaults._
ThisBuild / scalaVersion := "2.12.7"
val check = taskKey[Unit]("Check that tests are executed in parallel") val check = taskKey[Unit]("Check that tests are executed in parallel")
lazy val root = (project in file(".")). lazy val root = (project in file("."))
settings( .settings(
scalaVersion := "2.11.8",
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test, libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test,
fork in Test := true, fork in Test := true,
check := { check := {

View File

@ -1,6 +1,8 @@
scalaVersion in ThisBuild := "2.11.8" val specs = "org.specs2" %% "specs2-core" % "4.3.4"
concurrentRestrictions in Global := Seq(Tags.limitAll(4)) ThisBuild / scalaVersion := "2.12.7"
libraryDependencies += "org.specs2" %% "specs2-core" % "3.8.4" % Test
Global / concurrentRestrictions := Seq(Tags.limitAll(4))
libraryDependencies += specs % Test
inConfig(Test)(Seq( inConfig(Test)(Seq(
testGrouping := { testGrouping := {
val home = javaHome.value val home = javaHome.value

View File

@ -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()
)

View File

@ -1,3 +0,0 @@
package foo.test
object Foo { val foo = 5 }

View File

@ -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)
}
}
}

View File

@ -1,3 +0,0 @@
> test
> 'set javaOptions in Test += "-Dtest.init.fail=true"'
-> test

View File

@ -1,4 +1,4 @@
scalaVersion := "2.11.8" ThisBuild / scalaVersion := "2.12.7"
libraryDependencies += "org.scala-sbt" % "test-interface" % "1.0" libraryDependencies += "org.scala-sbt" % "test-interface" % "1.0"

View File

@ -5,13 +5,17 @@ val groupSize = 3
val groups = 3 val groups = 3
val check = TaskKey[Unit]("check", "Check all files were created and remove them.") 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 groupId(idx: Int) = "group_" + (idx + 1)
def groupPrefix(idx: Int) = groupId(idx) + "_file_" def groupPrefix(idx: Int) = groupId(idx) + "_file_"
lazy val root = (project in file(".")). ThisBuild / scalaVersion := "2.12.7"
settings( ThisBuild / organization := "org.example"
scalaVersion := "2.11.8",
lazy val root = (project in file("."))
.settings(
testGrouping in Test := { testGrouping in Test := {
val tests = (definedTests in Test).value val tests = (definedTests in Test).value
assert(tests.size == 3) assert(tests.size == 3)
@ -33,7 +37,7 @@ lazy val root = (project in file(".")).
}, },
concurrentRestrictions := Tags.limit(Tags.ForkedTestGroup, 2) :: Nil, concurrentRestrictions := Tags.limit(Tags.ForkedTestGroup, 2) :: Nil,
libraryDependencies ++= List( libraryDependencies ++= List(
"org.scala-lang.modules" %% "scala-xml" % "1.0.1", scalaxml,
"org.scalatest" %% "scalatest" % "2.2.6" % Test scalatest % Test
) )
) )

View File

@ -1,12 +1,11 @@
import org.scalatest.FlatSpec import org.scalatest.FlatSpec
import org.scalatest.matchers.MustMatchers
import java.io.File import java.io.File
trait Ensemble extends FlatSpec with MustMatchers { trait Ensemble extends FlatSpec {
def i: Int def i: Int
def prefix = System.getProperty("group.prefix") 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) val f = new File(prefix + i)
f.createNewFile f.createNewFile
} }

View File

@ -1,4 +1,6 @@
scalaVersion := "2.10.6" val scalatest = "org.scalatest" %% "scalatest" % "3.0.5"
fork := true
libraryDependencies += "org.scalatest" %% "scalatest" % "1.9" % "test" ThisBuild / scalaVersion := "2.12.7"
fork := true
libraryDependencies += scalatest % Test

View File

@ -1,9 +1,8 @@
import org.scalatest.FlatSpec 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 val v = Option(System.getenv("tests.max.value")) getOrElse Int.MaxValue
"A simple equation" must "hold" in { "A simple equation" should "hold" in {
Int.MaxValue must equal (v) assert(Int.MaxValue == v)
} }
} }

View File

@ -1,9 +1,10 @@
lazy val root = (project in file(".")). ThisBuild / scalaVersion := "2.12.7"
configs(IntegrationTest).
settings(
scalaVersion := "2.10.6",
Defaults.itSettings,
libraryDependencies += specs
)
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
)

View File

@ -11,11 +11,15 @@ val failingReportFile = "target/test-reports/another.pkg.FailingTest.xml"
val flatSuiteReportFile = "target/test-reports/my.scalatest.MyFlatSuite.xml" val flatSuiteReportFile = "target/test-reports/my.scalatest.MyFlatSuite.xml"
val nestedSuitesReportFile = "target/test-reports/my.scalatest.MyNestedSuites.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(".")). lazy val root = (project in file(".")).
settings( settings(
scalaVersion := "2.11.8", libraryDependencies += junitinterface % Test,
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test, libraryDependencies += scalatest % Test,
libraryDependencies += "org.scalatest" %% "scalatest" % "2.2.6" % Test,
// TODO use matchers instead of sys.error // TODO use matchers instead of sys.error
checkReport := { checkReport := {
val oneSecondReport = XML.loadFile(oneSecondReportFile) val oneSecondReport = XML.loadFile(oneSecondReportFile)

View File

@ -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") lazy val root = (project in file("."))
.settings(
parallelExecution in Test := true libraryDependencies += scalatest,
Test / testOptions += Tests.Argument("-C", "custom.CustomReporter"),
Test / parallelExecution := true
)

View File

@ -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") lazy val root = (project in file("."))
.settings(
parallelExecution in Test := false libraryDependencies += scalatest,
Test / testOptions += Tests.Argument("-C", "custom.CustomReporter"),
Test / parallelExecution := false
)

View File

@ -1,10 +1,11 @@
lazy val root = (project in file(".")). val scalatest = "org.scalatest" %% "scalatest" % "3.0.5"
settings( val scalaxml = "org.scala-lang.modules" %% "scala-xml" % "1.1.1"
scalaVersion := "2.11.8",
libraryDependencies ++= List( ThisBuild / scalaVersion := "2.12.7"
"org.scala-lang.modules" %% "scala-xml" % "1.0.1",
"org.scalatest" %% "scalatest" % "2.2.6" lazy val root = (project in file("."))
), .settings(
testOptions in Test += Tests.Argument("-r", "custom.CustomReporter"), libraryDependencies ++= List(scalatest, scalaxml),
Test / testOptions += Tests.Argument("-C", "custom.CustomReporter"),
fork := true fork := true
) )

View File

@ -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" name := "broken"
organization := "org.catastrophe"
//scalaVersion := "2.10.6"
scalaVersion := "2.12.3"

View File

@ -1,6 +1,5 @@
scalaVersion := "2.10.2" val specsJunit = "org.specs2" %% "specs2-junit" % "4.3.4"
val junitinterface = "com.novocode" % "junit-interface" % "0.11"
libraryDependencies += "com.novocode" % "junit-interface" % "0.10-M4" % "test" ThisBuild / scalaVersion := "2.12.7"
libraryDependencies += junitinterface % Test
libraryDependencies += "org.specs2" %% "specs2" % "2.1.1" % "test" libraryDependencies += specsJunit % Test

View File

@ -1,4 +1,5 @@
scalaVersion in ThisBuild := "2.11.8" val scalcheck = "org.scalacheck" %% "scalacheck" % "1.14.0"
parallelExecution in Test := false
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.10.0" % Test
ThisBuild / scalaVersion := "2.12.7"
Test / parallelExecution := false
libraryDependencies += scalcheck % Test

View File

@ -1,2 +1,3 @@
scalaVersion := "2.10.6" val specs = "org.specs2" %% "specs2-core" % "4.3.4"
libraryDependencies += "org.specs2" % "specs2_2.10" % "1.12.3" % "test" ThisBuild / scalaVersion := "2.12.7"
libraryDependencies += specs % Test

View File

@ -1,12 +1,16 @@
import sbt.internal.inc.ScalaInstance import sbt.internal.inc.ScalaInstance
lazy val OtherScala = config("other-scala").hide 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(".")) lazy val root = (project in file("."))
.configs(OtherScala) .configs(OtherScala)
.settings( .settings(
scalaVersion := "2.11.11", libraryDependencies += {
libraryDependencies += "org.scala-lang" % "scala-compiler" % "2.11.11" % OtherScala.name, "org.scala-lang" % "scala-compiler" % scalaVersion.value % OtherScala.name
},
managedClasspath in OtherScala := Classpaths.managedJars(OtherScala, classpathTypes.value, update.value), managedClasspath in OtherScala := Classpaths.managedJars(OtherScala, classpathTypes.value, update.value),
// Hack in the scala instance // Hack in the scala instance
@ -14,7 +18,7 @@ lazy val root = (project in file("."))
val rawJars = (managedClasspath in OtherScala).value.map(_.data) val rawJars = (managedClasspath in OtherScala).value.map(_.data)
val scalaHome = (target.value / "scala-home") val scalaHome = (target.value / "scala-home")
def removeVersion(name: String): String = def removeVersion(name: String): String =
name.replaceAll("\\-2.11.11", "") name.replaceAll("\\-2.12.7", "")
for(jar <- rawJars) { for(jar <- rawJars) {
val tjar = scalaHome / s"lib/${removeVersion(jar.getName)}" val tjar = scalaHome / s"lib/${removeVersion(jar.getName)}"
IO.copyFile(jar, tjar) IO.copyFile(jar, tjar)
@ -23,8 +27,8 @@ lazy val root = (project in file("."))
ScalaInstance(scalaHome, appConfiguration.value.provider.scalaProvider.launcher) ScalaInstance(scalaHome, appConfiguration.value.provider.scalaProvider.launcher)
}, },
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test, libraryDependencies += junitinterface % Test,
libraryDependencies += "com.typesafe.akka" %% "akka-actor" % "2.3.3" % Test, libraryDependencies += akkaActor % Test,
scalaModuleInfo := { scalaModuleInfo := {
val old = scalaModuleInfo.value val old = scalaModuleInfo.value

View File

@ -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( val commonSettings = Seq(
libraryDependencies += "org.scalatest" %% "scalatest" % "1.9.1" % Test libraryDependencies += scalatest % Test
) )
lazy val root = (project in file(".")). lazy val root = (project in file("."))
aggregate(sub1, sub2). .aggregate(sub1, sub2)
settings(inThisBuild(List( .settings(
organization := "com.example",
version := "0.0.1-SNAPSHOT",
scalaVersion := "2.10.6"
)),
commonSettings commonSettings
) )
lazy val rootRef = LocalProject("root") lazy val rootRef = LocalProject("root")
lazy val sub1 = project. lazy val sub1 = project
dependsOn(rootRef). .dependsOn(rootRef)
settings( .settings(
commonSettings commonSettings
) )
lazy val sub2 = project. lazy val sub2 = project
dependsOn(rootRef). .dependsOn(rootRef)
settings( .settings(
commonSettings commonSettings
) )

View File

@ -1,2 +1,3 @@
scalaVersion := "2.10.6" val scalatest = "org.scalatest" %% "scalatest" % "3.0.5"
libraryDependencies += "org.scalatest" %% "scalatest" % "1.9.1" ThisBuild / scalaVersion := "2.12.7"
libraryDependencies += scalatest

View File

@ -1,17 +1,15 @@
import org.scalatest.FlatSpec import org.scalatest.FlatSpec
import org.scalatest.matchers.MustMatchers
import java.io.File import java.io.File
class CheckSetupCleanup extends FlatSpec with MustMatchers class CheckSetupCleanup extends FlatSpec {
{
val f = new File("setup") 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) assert(f.exists, "Setup file didn't exist: " + f.getAbsolutePath)
f.delete() f.delete()
} }
val t = new File("tested") 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) assert(!t.exists, "Cleanup file already existed: " + t.getAbsolutePath)
t.createNewFile() t.createNewFile()
} }

View File

@ -1,5 +1,4 @@
scalaVersion := "2.10.6" val scalatest = "org.scalatest" %% "scalatest" % "3.0.5"
ThisBuild / scalaVersion := "2.12.7"
libraryDependencies += "org.scalatest" %% "scalatest" % "2.0.M6-SNAP28" libraryDependencies += scalatest
Test / testOptions += Tests.Argument("-C", "custom.CustomReporter")
testOptions in Test += Tests.Argument("-r", "custom.CustomReporter")

View File

@ -1,4 +1,4 @@
lazy val specs2 = "org.specs2" %% "specs2" % "2.3.11" val specs = "org.specs2" %% "specs2-core" % "4.3.4"
scalaVersion := "2.11.8" ThisBuild / scalaVersion := "2.12.7"
libraryDependencies += specs2 % Test libraryDependencies += specs % Test

View File

@ -4,14 +4,14 @@ import java.io.{ CharArrayWriter, PrintWriter }
val marker = new File("marker") val marker = new File("marker")
val check = TaskKey[Unit]("check", "Check correct error has been returned.") 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(".")). lazy val root = (project in file(".")).
settings( settings(
libraryDependencies ++= List( libraryDependencies ++= List(scalaxml, scalatest),
"org.scala-lang.modules" %% "scala-xml" % "1.0.1",
"org.scalatest" %% "scalatest" % "2.2.6"
),
scalaVersion := "2.11.8",
fork := true, fork := true,
testListeners += new TestReportListener { testListeners += new TestReportListener {
def testEvent(event: TestEvent): Unit = { def testEvent(event: TestEvent): Unit = {

View File

@ -1,5 +1,4 @@
scalaVersion := "2.10.6" val scalatest = "org.scalatest" %% "scalatest" % "3.0.5"
ThisBuild / scalaVersion := "2.12.7"
libraryDependencies += "org.scalatest" %% "scalatest" % "2.0.M6-SNAP28" libraryDependencies += scalatest
Test / testOptions += Tests.Argument("-C", "custom.CustomReporter")
testOptions in Test += Tests.Argument("-r", "custom.CustomReporter")

View File

@ -1,6 +1,8 @@
lazy val root = (project in file(".")). val scalatest = "org.scalatest" %% "scalatest" % "3.0.5"
settings( ThisBuild / scalaVersion := "2.12.7"
scalaVersion := "2.10.6",
libraryDependencies += "org.scalatest" %% "scalatest" % "1.9.1" % Test, lazy val root = (project in file("."))
parallelExecution in test := false .settings(
libraryDependencies += scalatest % Test,
Test / parallelExecution := false
) )

View File

@ -1,14 +1,13 @@
import java.io.File import java.io.File
import org.scalatest.FlatSpec import org.scalatest.FlatSpec
import org.scalatest.matchers.ShouldMatchers
class Test1 extends FlatSpec with ShouldMatchers { class Test1 extends FlatSpec {
"a test" should "pass" in { "a test" should "pass" in {
new File("target/Test1.run").createNewFile() new File("target/Test1.run").createNewFile()
} }
} }
class Test2 extends FlatSpec with ShouldMatchers { class Test2 extends FlatSpec {
"a test" should "pass" in { "a test" should "pass" in {
new File("target/Test2.run").createNewFile() new File("target/Test2.run").createNewFile()
} }

View File

@ -1,9 +1,9 @@
lazy val root = (project in file(".")). val scalatest = "org.scalatest" %% "scalatest" % "3.0.5"
settings( val scalaxml = "org.scala-lang.modules" %% "scala-xml" % "1.1.1"
scalaVersion := "2.11.8", ThisBuild / scalaVersion := "2.12.7"
libraryDependencies ++= List(
"org.scala-lang.modules" %% "scala-xml" % "1.0.1", lazy val root = (project in file("."))
"org.scalatest" %% "scalatest" % "2.2.6" .settings(
), libraryDependencies ++= List(scalaxml, scalatest),
parallelExecution in test := false Test / parallelExecution := false
) )

View File

@ -1,5 +1,7 @@
import sbt.internal.server.{ ServerHandler, ServerIntent } import sbt.internal.server.{ ServerHandler, ServerIntent }
ThisBuild / scalaVersion := "2.12.7"
lazy val root = (project in file(".")) lazy val root = (project in file("."))
.settings( .settings(
Global / serverLog / logLevel := Level.Debug, Global / serverLog / logLevel := Level.Debug,
@ -20,5 +22,4 @@ lazy val root = (project in file("."))
}), }),
name := "handshake", name := "handshake",
scalaVersion := "2.12.3",
) )