diff options
author | Nikolay Tatarinov <5min4eq.unity@gmail.com> | 2018-02-22 11:18:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-22 11:18:45 +0300 |
commit | 2cbc8d403715bc909325c9323ef58ffb47b22e1f (patch) | |
tree | 3cebde274f4f31a643e6d9c9d728b01d83649130 /scalalib/src | |
parent | 107ba88754673e08b030b9ba1c8f4e6f1eefd13d (diff) | |
download | mill-2cbc8d403715bc909325c9323ef58ffb47b22e1f.tar.gz mill-2cbc8d403715bc909325c9323ef58ffb47b22e1f.tar.bz2 mill-2cbc8d403715bc909325c9323ef58ffb47b22e1f.zip |
support multiple test frameworks (#148)
support multiple test frameworks
Diffstat (limited to 'scalalib/src')
-rw-r--r-- | scalalib/src/mill/scalalib/ScalaModule.scala | 6 | ||||
-rw-r--r-- | scalalib/src/mill/scalalib/ScalaWorkerApi.scala | 2 | ||||
-rw-r--r-- | scalalib/src/mill/scalalib/TestRunner.scala | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/scalalib/src/mill/scalalib/ScalaModule.scala b/scalalib/src/mill/scalalib/ScalaModule.scala index dd9fa91e..ffaaeac8 100644 --- a/scalalib/src/mill/scalalib/ScalaModule.scala +++ b/scalalib/src/mill/scalalib/ScalaModule.scala @@ -294,7 +294,7 @@ object TestModule{ } trait TestModule extends ScalaModule with TaskModule { override def defaultCommandName() = "test" - def testFramework: T[String] + def testFrameworks: T[Seq[String]] def forkWorkingDir = ammonite.ops.pwd @@ -307,7 +307,7 @@ trait TestModule extends ScalaModule with TaskModule { jvmArgs = forkArgs(), envArgs = forkEnv(), mainArgs = Seq( - testFramework(), + testFrameworks().mkString(" "), runClasspath().map(_.path).mkString(" "), Seq(compile().classes.path).mkString(" "), args.mkString(" "), @@ -326,7 +326,7 @@ trait TestModule extends ScalaModule with TaskModule { val outputPath = T.ctx().dest/"out.json" mill.scalalib.ScalaWorkerApi.scalaWorker().runTests( - TestRunner.framework(testFramework()), + TestRunner.frameworks(testFrameworks()), runClasspath().map(_.path), Agg(compile().classes.path), args diff --git a/scalalib/src/mill/scalalib/ScalaWorkerApi.scala b/scalalib/src/mill/scalalib/ScalaWorkerApi.scala index 4cec0696..964179a9 100644 --- a/scalalib/src/mill/scalalib/ScalaWorkerApi.scala +++ b/scalalib/src/mill/scalalib/ScalaWorkerApi.scala @@ -57,7 +57,7 @@ trait ScalaWorkerApi { upstreamCompileOutput: Seq[CompilationResult]) (implicit ctx: mill.util.Ctx): mill.eval.Result[CompilationResult] - def runTests(frameworkInstance: ClassLoader => sbt.testing.Framework, + def runTests(frameworkInstances: ClassLoader => Seq[sbt.testing.Framework], entireClasspath: Agg[Path], testClassfilePath: Agg[Path], args: Seq[String]) diff --git a/scalalib/src/mill/scalalib/TestRunner.scala b/scalalib/src/mill/scalalib/TestRunner.scala index 0654e5ef..7bee681f 100644 --- a/scalalib/src/mill/scalalib/TestRunner.scala +++ b/scalalib/src/mill/scalalib/TestRunner.scala @@ -2,10 +2,10 @@ package mill.scalalib import mill.util.JsonFormatters._ object TestRunner { - def framework(frameworkName: String)(cl: ClassLoader): sbt.testing.Framework = { - cl.loadClass(frameworkName) - .newInstance() - .asInstanceOf[sbt.testing.Framework] + def frameworks(frameworkNames: Seq[String])(cl: ClassLoader): Seq[sbt.testing.Framework] = { + frameworkNames.map { name => + cl.loadClass(name).newInstance().asInstanceOf[sbt.testing.Framework] + } } case class Result(fullyQualifiedName: String, |