summaryrefslogtreecommitdiff
path: root/scalanativelib
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2019-06-08 12:18:11 +0800
committerGitHub <noreply@github.com>2019-06-08 12:18:11 +0800
commit102ddfd655fd0ae8cf505b0a12519ff8e2655eb6 (patch)
treece8e5e54a6c60ce6ba1871c939117eb9804329cf /scalanativelib
parent26a18d8e5a0faf839f192ec8527acdd6b6bb55fb (diff)
downloadmill-102ddfd655fd0ae8cf505b0a12519ff8e2655eb6.tar.gz
mill-102ddfd655fd0ae8cf505b0a12519ff8e2655eb6.tar.bz2
mill-102ddfd655fd0ae8cf505b0a12519ff8e2655eb6.zip
replace testFrameworksJvmClasspath and testClasspathJvm with just runClasspath (#627)
Diffstat (limited to 'scalanativelib')
-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))