summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2019-06-08 10:48:01 +0800
committerLi Haoyi <haoyi.sg@gmail.com>2019-06-08 10:48:01 +0800
commitbd739a639663f398c9fa63a3c2950c9405a74e82 (patch)
tree0d83cc69fdd2a97ffd0729cc63d8b0b77861e0cf
parent0b2af2476d63d056e496e24be5481877cb39e62d (diff)
downloadmill-test.tar.gz
mill-test.tar.bz2
mill-test.zip
replace testFrameworksJvmClasspath and testClasspathJvm with just runClasspathtest
-rw-r--r--scalanativelib/src/ScalaNativeModule.scala25
1 files changed, 3 insertions, 22 deletions
diff --git a/scalanativelib/src/ScalaNativeModule.scala b/scalanativelib/src/ScalaNativeModule.scala
index b04b00a1..d6fb66bd 100644
--- a/scalanativelib/src/ScalaNativeModule.scala
+++ b/scalanativelib/src/ScalaNativeModule.scala
@@ -173,7 +173,7 @@ trait TestScalaNativeModule extends ScalaNativeModule with TestModule { testOute
// The test frameworks run under the JVM and communicate with the native binary over a socket
// therefore the test framework is loaded from a JVM classloader
val testClassloader =
- new URLClassLoader(testClasspathJvm().map(_.path.toIO.toURI.toURL).toArray,
+ new URLClassLoader(runClasspath().map(_.path.toIO.toURI.toURL).toArray,
this.getClass.getClassLoader)
val frameworkInstances = TestRunner.frameworks(testFrameworks())(testClassloader)
val testBinary = testRunnerNative.nativeLink().toIO
@@ -186,7 +186,7 @@ trait TestScalaNativeModule extends ScalaNativeModule with TestModule { testOute
val (doneMsg, results) = TestRunner.runTests(
nativeFrameworks,
- testClasspathJvm().map(_.path),
+ runClasspath().map(_.path),
Agg(compile().classes.path),
args
)
@@ -194,25 +194,6 @@ trait TestScalaNativeModule extends ScalaNativeModule with TestModule { testOute
TestModule.handleResults(doneMsg, results)
}
- private val supportedTestFrameworks = Set("utest", "scalatest")
-
- // get the JVM classpath entries for supported test frameworks
- def testFrameworksJvmClasspath = T{
- Lib.resolveDependencies(
- repositories,
- Lib.depToDependency(_, scalaVersion(), ""),
- transitiveIvyDeps().filter(d => d.cross.isBinary && supportedTestFrameworks(d.dep.module.name.value)),
- ctx = Some(implicitly[mill.util.Ctx.Log])
- )
- }
-
- def testClasspathJvm = T{
- localClasspath() ++
- transitiveLocalClasspath() ++
- unmanagedClasspath() ++
- testFrameworksJvmClasspath()
- }
-
// creates a specific binary used for running tests - has a different (generated) main class
// which knows the names of all the tests and references to invoke them
object testRunnerNative extends ScalaNativeModule {
@@ -243,7 +224,7 @@ trait TestScalaNativeModule extends ScalaNativeModule with TestModule { testOute
val frameworkInstances = TestRunner.frameworks(testFrameworks()) _
val testClasses =
- Jvm.inprocess(testClasspathJvm().map(_.path), classLoaderOverrideSbtTesting = true, isolated = true, closeContextClassLoaderWhenDone = true,
+ Jvm.inprocess(runClasspath().map(_.path), classLoaderOverrideSbtTesting = true, isolated = true, closeContextClassLoaderWhenDone = true,
cl => {
frameworkInstances(cl).flatMap { framework =>
val df = Lib.discoverTests(cl, framework, Agg(compile().classes.path))