Junit5

mill.scalalib.TestModule.Junit5
@Scaladoc(value = "/**\n * TestModule that uses JUnit 5 Framework to run tests.\n * You may want to provide the junit dependency explicitly to use another version.\n */")
trait Junit5 extends TestModule

TestModule that uses JUnit 5 Framework to run tests. You may want to provide the junit dependency explicitly to use another version.

Attributes

Source
TestModule.scala
Graph
Supertypes
trait TestModule
trait TaskModule
trait RunModule
trait BspModule
trait Module
trait Wrapper
class BaseClass
trait Cacher
trait Cacher
class Object
trait Matchable
class Any
Show all
Known subtypes

Members list

Type members

Inherited classlikes

@Scaladoc(value = "/**\n * Miscellaneous machinery around traversing & querying the build hierarchy,\n * that should not be needed by normal users of Mill\n */")
object moduleInternal extends Internal

Miscellaneous machinery around traversing & querying the build hierarchy, that should not be needed by normal users of Mill

Miscellaneous machinery around traversing & querying the build hierarchy, that should not be needed by normal users of Mill

Attributes

Inherited from:
Module
Source
Module.scala
Supertypes
class Internal
class Object
trait Matchable
class Any

Value members

Concrete methods

@Scaladoc(value = "/**\n * Overridden since Junit5 has its own discovery mechanism.\n *\n * This is basically a re-implementation of sbt\'s plugin for Junit5 test\n * discovery mechanism. See\n * https://github.com/sbt/sbt-jupiter-interface/blob/468d4f31f1f6ce8529fff8a8804dd733974c7686/src/plugin/src/main/scala/com/github/sbt/junit/jupiter/sbt/JupiterPlugin.scala#L97C15-L118\n * for details.\n *\n * Note that we access the test discovery via reflection, to avoid mill\n * itself having a dependency on Junit5. Hence, if you remove the\n * `sbt-jupiter-interface` dependency from `ivyDeps`, make sure to also\n * override this method.\n */")
override def discoveredTestClasses: Target[Seq[String]]

Overridden since Junit5 has its own discovery mechanism.

Overridden since Junit5 has its own discovery mechanism.

This is basically a re-implementation of sbt's plugin for Junit5 test discovery mechanism. See https://github.com/sbt/sbt-jupiter-interface/blob/468d4f31f1f6ce8529fff8a8804dd733974c7686/src/plugin/src/main/scala/com/github/sbt/junit/jupiter/sbt/JupiterPlugin.scala#L97C15-L118 for details.

Note that we access the test discovery via reflection, to avoid mill itself having a dependency on Junit5. Hence, if you remove the sbt-jupiter-interface dependency from ivyDeps, make sure to also override this method.

Attributes

Definition Classes
Source
TestModule.scala
override def ivyDeps: Target[Seq[Dep]]

Attributes

Definition Classes
Source
TestModule.scala
override def testFramework: Target[String]

The test framework to use.

The test framework to use.

For convenience, you can also mix-in one of these predefined traits:

Attributes

Definition Classes
Source
TestModule.scala

Inherited methods

def allLocalMainClasses: Target[Seq[String]]

Attributes

Inherited from:
RunModule
Source
RunModule.scala

Use to fill most fields of BuildTarget.

Use to fill most fields of BuildTarget.

Attributes

Definition Classes
Inherited from:
TestModule
Source
TestModule.scala
@Scaladoc(value = "/**\n * Use to populate the `BuildTarget.{dataKind,data}` fields.\n *\n * Mill specific implementations:\n * - [[JvmBuildTarget]]\n * - [[ScalaBuildTarget]]\n */")
def bspBuildTargetData: Task[Option[(String, AnyRef)]]

Use to populate the BuildTarget.{dataKind,data} fields.

Use to populate the BuildTarget.{dataKind,data} fields.

Mill specific implementations:

Attributes

Inherited from:
BspModule
Source
BspModule.scala
def bspDisplayName: String

Attributes

Inherited from:
BspModule
Source
BspModule.scala
def bspDisplayName0: String

Attributes

Inherited from:
BspModule
Source
BspModule.scala
override def defaultCommandName(): String

The name of the default command, which will be automatically executed if the module name is provided at the Mill command line.

The name of the default command, which will be automatically executed if the module name is provided at the Mill command line.

Attributes

Definition Classes
Inherited from:
TestModule
Source
TestModule.scala
def finalMainClass: Target[String]

Attributes

Inherited from:
RunModule
Source
RunModule.scala
def finalMainClassOpt: Target[Either[String, String]]

Attributes

Inherited from:
RunModule
Source
RunModule.scala
@Scaladoc(value = "/**\n * Any command-line parameters you want to pass to the forked JVM.\n */")
def forkArgs: Target[Seq[String]]

Any command-line parameters you want to pass to the forked JVM.

Any command-line parameters you want to pass to the forked JVM.

Attributes

Inherited from:
RunModule
Source
RunModule.scala
@Scaladoc(value = "/**\n * Any environment variables you want to pass to the forked JVM.\n */")
def forkEnv: Target[Map[String, String]]

Any environment variables you want to pass to the forked JVM.

Any environment variables you want to pass to the forked JVM.

Attributes

Inherited from:
RunModule
Source
RunModule.scala
def forkWorkingDir: Target[Path]

Attributes

Inherited from:
RunModule
Source
RunModule.scala
def getTestEnvironmentVars(args: String*): Command[(String, String, String, Seq[String])]

Attributes

Inherited from:
TestModule
Source
TestModule.scala
@Scaladoc(value = "/**\n * Builds a command-line \"launcher\" file that can be used to run this module\'s\n * code, without the Mill process. Useful for deployment & other places where\n * you do not want a build tool running\n */")

Builds a command-line "launcher" file that can be used to run this module's code, without the Mill process. Useful for deployment & other places where you do not want a build tool running

Builds a command-line "launcher" file that can be used to run this module's code, without the Mill process. Useful for deployment & other places where you do not want a build tool running

Attributes

Inherited from:
RunModule
Source
RunModule.scala
@Scaladoc(value = "/**\n * The elements of the run classpath which are local to this module.\n * This is typically the output of a compilation step and bundles runtime resources.\n */")

The elements of the run classpath which are local to this module. This is typically the output of a compilation step and bundles runtime resources.

The elements of the run classpath which are local to this module. This is typically the output of a compilation step and bundles runtime resources.

Attributes

Inherited from:
RunModule
Source
RunModule.scala
@Scaladoc(value = "/**\n * Allows you to specify an explicit main class to use for the `run` command.\n * If none is specified, the classpath is searched for an appropriate main\n * class to use if one exists.\n */")
def mainClass: Target[Option[String]]

Allows you to specify an explicit main class to use for the run command. If none is specified, the classpath is searched for an appropriate main class to use if one exists.

Allows you to specify an explicit main class to use for the run command. If none is specified, the classpath is searched for an appropriate main class to use if one exists.

Attributes

Inherited from:
RunModule
Source
RunModule.scala
def moduleCtx: Ctx

Attributes

Inherited from:
BaseClass
Source
Module.scala
def moduleDir: Path

Attributes

Inherited from:
Module
Source
Module.scala

Attributes

Inherited from:
Module
Source
Module.scala

Attributes

Inherited from:
Module
Source
Module.scala
def resources: Target[Seq[PathRef]]

Attributes

Inherited from:
JavaModuleBase
Source
TestModule.scala
@Scaladoc(value = "/**\n * Runs this module\'s code in a subprocess and waits for it to finish\n */")
def run(args: Task[Args]): Command[Unit]

Runs this module's code in a subprocess and waits for it to finish

Runs this module's code in a subprocess and waits for it to finish

Attributes

Inherited from:
RunModule
Source
RunModule.scala
@Scaladoc(value = "/**\n * If true, stdout and stderr of the process executed by `runBackground`\n * or `runMainBackground` is sent to mill\'s stdout/stderr (which usually\n * flow to the console).\n *\n * If false, output will be directed to files `stdout.log` and `stderr.log`\n * in `runBackground.dest` (or `runMainBackground.dest`)\n */")

If true, stdout and stderr of the process executed by runBackground or runMainBackground is sent to mill's stdout/stderr (which usually flow to the console).

If true, stdout and stderr of the process executed by runBackground or runMainBackground is sent to mill's stdout/stderr (which usually flow to the console).

If false, output will be directed to files stdout.log and stderr.log in runBackground.dest (or runMainBackground.dest)

Attributes

Inherited from:
RunModule
Source
RunModule.scala

Attributes

Inherited from:
RunModule
Source
RunModule.scala
def runBackgroundTask(mainClass: Task[String], args: Task[Args]): Task[Unit]

Attributes

Inherited from:
RunModule
Source
RunModule.scala
@Scaladoc(value = "/**\n * All classfiles and resources including upstream modules and dependencies\n * necessary to run this module\'s code.\n */")

All classfiles and resources including upstream modules and dependencies necessary to run this module's code.

All classfiles and resources including upstream modules and dependencies necessary to run this module's code.

Attributes

Inherited from:
RunModule
Source
RunModule.scala
@Scaladoc(value = "/**\n * Runs this module\'s code in a subprocess and waits for it to finish\n */")
def runForkedTask(mainClass: Task[String], args: Task[Args]): Task[Unit]

Runs this module's code in a subprocess and waits for it to finish

Runs this module's code in a subprocess and waits for it to finish

Attributes

Inherited from:
RunModule
Source
RunModule.scala
@Scaladoc(value = "/**\n * Runs this module\'s code in-process within an isolated classloader. This is\n * faster than `run`, but in exchange you have less isolation between runs\n * since the code can dirty the parent Mill process and potentially leave it\n * in a bad state.\n */")
def runLocal(args: Task[Args]): Command[Unit]

Runs this module's code in-process within an isolated classloader. This is faster than run, but in exchange you have less isolation between runs since the code can dirty the parent Mill process and potentially leave it in a bad state.

Runs this module's code in-process within an isolated classloader. This is faster than run, but in exchange you have less isolation between runs since the code can dirty the parent Mill process and potentially leave it in a bad state.

Attributes

Inherited from:
RunModule
Source
RunModule.scala
def runLocalTask(mainClass: Task[String], args: Task[Args]): Task[Unit]

Attributes

Inherited from:
RunModule
Source
RunModule.scala
@Scaladoc(value = "/**\n * Same as `run`, but lets you specify a main class to run\n */")
def runMain(mainClass: String, args: String*): Command[Unit]

Same as run, but lets you specify a main class to run

Same as run, but lets you specify a main class to run

Attributes

Inherited from:
RunModule
Source
RunModule.scala
@Scaladoc(value = "/**\n * Same as `runBackground`, but lets you specify a main class to run\n */")
def runMainBackground(mainClass: String, args: String*): Command[Unit]

Same as runBackground, but lets you specify a main class to run

Same as runBackground, but lets you specify a main class to run

Attributes

Inherited from:
RunModule
Source
RunModule.scala
@Scaladoc(value = "/**\n * Same as `runLocal`, but lets you specify a main class to run\n */")
def runMainLocal(mainClass: String, args: String*): Command[Unit]

Same as runLocal, but lets you specify a main class to run

Same as runLocal, but lets you specify a main class to run

Attributes

Inherited from:
RunModule
Source
RunModule.scala
@Scaladoc(value = "/**\n * Control whether `run*`-targets should use an args file to pass command line args, if possible.\n */")
def runUseArgsFile: Target[Boolean]

Control whether run*-targets should use an args file to pass command line args, if possible.

Control whether run*-targets should use an args file to pass command line args, if possible.

Attributes

Inherited from:
RunModule
Source
RunModule.scala

Attributes

Inherited from:
RunModule
Source
RunModule.scala
@Scaladoc(value = "/**\n * Discovers and runs the module\'s tests in a subprocess, reporting the\n * results to the console.\n * If no input has changed since the last run, no test were executed.\n *\n * @see [[testForked()]]\n */")
def testCached: Target[(String, Seq[TestResult])]

Discovers and runs the module's tests in a subprocess, reporting the results to the console. If no input has changed since the last run, no test were executed.

Discovers and runs the module's tests in a subprocess, reporting the results to the console. If no input has changed since the last run, no test were executed.

Attributes

See also
Inherited from:
TestModule
Source
TestModule.scala
@Scaladoc(value = "/**\n * Args to be used by [[testCached]].\n */")
def testCachedArgs: Target[Seq[String]]

Args to be used by testCached.

Args to be used by testCached.

Attributes

Inherited from:
TestModule
Source
TestModule.scala
@Scaladoc(value = "/**\n * The classpath containing the tests. This is most likely the output of the compilation target.\n * By default, this uses the result of [[localRunClasspath]], which is most likely the result of a local compilation.\n */")

The classpath containing the tests. This is most likely the output of the compilation target. By default, this uses the result of localRunClasspath, which is most likely the result of a local compilation.

The classpath containing the tests. This is most likely the output of the compilation target. By default, this uses the result of localRunClasspath, which is most likely the result of a local compilation.

Attributes

Inherited from:
TestModule
Source
TestModule.scala
@Scaladoc(value = "/**\n * How the test classes in this module will be split into multiple JVM processes\n * and run in parallel during testing. Defaults to all of them running in one process\n * sequentially, but can be overridden to split them into separate groups that run\n * in parallel.\n */")
def testForkGrouping: Target[Seq[Seq[String]]]

How the test classes in this module will be split into multiple JVM processes and run in parallel during testing. Defaults to all of them running in one process sequentially, but can be overridden to split them into separate groups that run in parallel.

How the test classes in this module will be split into multiple JVM processes and run in parallel during testing. Defaults to all of them running in one process sequentially, but can be overridden to split them into separate groups that run in parallel.

Attributes

Inherited from:
TestModule
Source
TestModule.scala
@Scaladoc(value = "/**\n * Discovers and runs the module\'s tests in a subprocess, reporting the\n * results to the console.\n * @see [[testCached]]\n */")
def testForked(args: String*): Command[(String, Seq[TestResult])]

Discovers and runs the module's tests in a subprocess, reporting the results to the console.

Discovers and runs the module's tests in a subprocess, reporting the results to the console.

Attributes

See also
Inherited from:
TestModule
Source
TestModule.scala
@Scaladoc(value = "/**\n * Discovers and runs the module\'s tests in-process in an isolated classloader,\n * reporting the results to the console\n */")
def testLocal(args: String*): Command[(String, Seq[TestResult])]

Discovers and runs the module's tests in-process in an isolated classloader, reporting the results to the console

Discovers and runs the module's tests in-process in an isolated classloader, reporting the results to the console

Attributes

Inherited from:
TestModule
Source
TestModule.scala
@Scaladoc(value = "/**\n * Discovers and runs the module\'s tests in a subprocess, reporting the\n * results to the console.\n * Arguments before \"--\" will be used as wildcard selector to select\n * test classes, arguments after \"--\" will be passed as regular arguments.\n * `testOnly *foo foobar bar* -- arguments` will test only classes with name\n * (includes package name) 1. end with \"foo\", 2. exactly \"foobar\", 3. start\n * with \"bar\", with \"arguments\" as arguments passing to test framework.\n */")
def testOnly(args: String*): Command[(String, Seq[TestResult])]

Discovers and runs the module's tests in a subprocess, reporting the results to the console. Arguments before "--" will be used as wildcard selector to select test classes, arguments after "--" will be passed as regular arguments. testOnly *foo foobar bar* -- arguments will test only classes with name (includes package name) 1. end with "foo", 2. exactly "foobar", 3. start with "bar", with "arguments" as arguments passing to test framework.

Discovers and runs the module's tests in a subprocess, reporting the results to the console. Arguments before "--" will be used as wildcard selector to select test classes, arguments after "--" will be passed as regular arguments. testOnly *foo foobar bar* -- arguments will test only classes with name (includes package name) 1. end with "foo", 2. exactly "foobar", 3. start with "bar", with "arguments" as arguments passing to test framework.

Attributes

Inherited from:
TestModule
Source
TestModule.scala
@Scaladoc(value = "/**\n * Sets the file name for the generated JUnit-compatible test report.\n * If None is set, no file will be generated.\n */")
def testReportXml: Target[Option[String]]

Sets the file name for the generated JUnit-compatible test report. If None is set, no file will be generated.

Sets the file name for the generated JUnit-compatible test report. If None is set, no file will be generated.

Attributes

Inherited from:
TestModule
Source
TestModule.scala
@Scaladoc(value = "/**\n * Whether to use the test task destination folder as the working directory\n * when running tests. `true` means test subprocess run in the `.dest/sandbox` folder of\n * the test task, providing better isolation and encouragement of best practices\n * (e.g. not reading/writing stuff randomly from the project source tree). `false`\n * means the test subprocess runs in the project root folder, providing weaker\n * isolation.\n */")

Whether to use the test task destination folder as the working directory when running tests. true means test subprocess run in the .dest/sandbox folder of the test task, providing better isolation and encouragement of best practices (e.g. not reading/writing stuff randomly from the project source tree). false means the test subprocess runs in the project root folder, providing weaker isolation.

Whether to use the test task destination folder as the working directory when running tests. true means test subprocess run in the .dest/sandbox folder of the test task, providing better isolation and encouragement of best practices (e.g. not reading/writing stuff randomly from the project source tree). false means the test subprocess runs in the project root folder, providing weaker isolation.

Attributes

Inherited from:
TestModule
Source
TestModule.scala
@Scaladoc(value = "/**\n * Controls whether the TestRunner should receive its arguments via an args-file instead of a long parameter list.\n * Defaults to what `runUseArgsFile` return.\n */")
def testUseArgsFile: Target[Boolean]

Controls whether the TestRunner should receive its arguments via an args-file instead of a long parameter list. Defaults to what runUseArgsFile return.

Controls whether the TestRunner should receive its arguments via an args-file instead of a long parameter list. Defaults to what runUseArgsFile return.

Attributes

Inherited from:
TestModule
Source
TestModule.scala
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Module -> Any
Inherited from:
Module
Source
Module.scala

Attributes

Inherited from:
WithZincWorker
Source
WithZincWorker.scala

Inherited and Abstract methods

Attributes

Inherited from:
TestModule
Source
TestModule.scala

Implicits

Inherited implicits

implicit def moduleNestedCtx: Nested

Attributes

Inherited from:
Module
Source
Module.scala