You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This idea of this change is to restructure the `TestModule` to decouple
it from the concept of compilation. After this change, only a
`runClasspath` and a `testClasspath` is needed to run tests. This makes
adding test modules for the sake of using a different test framework a
breeze.
See the following example: the `test2` module is an additional test
framework on the same classes of `test`.
```scala
import mill._
import mill.scalalib._
import mill.scalalib.api.CompilationResult
object foo extends RootModule with ScalaModule {
def scalaVersion = "2.13.11"
def ivyDeps = Agg(
ivy"com.lihaoyi::scalatags:0.12.0",
ivy"com.lihaoyi::mainargs:0.6.2"
)
object test extends ScalaTests {
def ivyDeps = Agg(
ivy"com.lihaoyi::utest:0.7.11",
ivy"org.scalatest::scalatest-freespec:3.2.18"
)
def testFramework = "utest.runner.Framework"
}
object test2 extends TestModule with TestModule.ScalaTest {
override def compile: T[CompilationResult] = ???
override def runClasspath: T[Seq[PathRef]] = foo.test.runClasspath()
override def testClasspath = foo.test.testClasspath()
}
}
```
Please note the `compile` target is a legacy to our binary-compatibility
promise. The target is not used directly in `TestModule`.
This pull request additionally contains the following changes:
* Introduces a new `RunModule` and moved some `run`-related task
previously in `TestModule` up.
* Extend `RunModule` in `JavaModule` to share run-releated targets and
resolve super-hierarchy
* Introduces a `WithZincWorker` as a shared base trait to resolve
super-hierarchies for using and overriding a common worker.
I plan to move more run-releated target from `JavaModule` to `RunModule`
in a subsequent PR. (See #3090)
See also the following discussion:
* #3076
Pull request: #3064
0 commit comments