diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-11 15:39:26 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-11 16:43:31 -0800 |
commit | fcbb9c9fd65211d6d5ac40333528fa059c947d0a (patch) | |
tree | de0b6ebd7dcd9907d62954247063cfa0138681dd /main | |
parent | 521e8cbbf5f7331fa59147445b68a858f179a9ba (diff) | |
download | mill-fcbb9c9fd65211d6d5ac40333528fa059c947d0a.tar.gz mill-fcbb9c9fd65211d6d5ac40333528fa059c947d0a.tar.bz2 mill-fcbb9c9fd65211d6d5ac40333528fa059c947d0a.zip |
make test-mill-release run integration tests using the release assembly
Diffstat (limited to 'main')
-rw-r--r-- | main/test/src/mill/main/JavaCompileJarTests.scala | 2 | ||||
-rw-r--r-- | main/test/src/mill/util/ScriptTestSuite.scala | 18 | ||||
-rw-r--r-- | main/test/src/mill/util/TestEvaluator.scala | 4 |
3 files changed, 16 insertions, 8 deletions
diff --git a/main/test/src/mill/main/JavaCompileJarTests.scala b/main/test/src/mill/main/JavaCompileJarTests.scala index fb047675..635ac3c5 100644 --- a/main/test/src/mill/main/JavaCompileJarTests.scala +++ b/main/test/src/mill/main/JavaCompileJarTests.scala @@ -4,7 +4,7 @@ import ammonite.ops._ import mill.util.ScriptTestSuite import utest._ -object JavaCompileJarTests extends ScriptTestSuite { +object JavaCompileJarTests extends ScriptTestSuite(fork = false) { def workspaceSlug = "java-compile-jar" def scriptSourcePath = pwd / 'main / 'test / 'resources / 'examples / 'javac val tests = Tests{ diff --git a/main/test/src/mill/util/ScriptTestSuite.scala b/main/test/src/mill/util/ScriptTestSuite.scala index 0d1ff43a..8958b464 100644 --- a/main/test/src/mill/util/ScriptTestSuite.scala +++ b/main/test/src/mill/util/ScriptTestSuite.scala @@ -5,19 +5,27 @@ import java.io.{ByteArrayInputStream, ByteArrayOutputStream, PrintStream} import ammonite.ops._ import utest._ -abstract class ScriptTestSuite extends TestSuite{ +abstract class ScriptTestSuite(fork: Boolean) extends TestSuite{ def workspaceSlug: String def scriptSourcePath: Path val workspacePath = pwd / 'target / 'workspace / workspaceSlug -// val stdOutErr = new PrintStream(new ByteArrayOutputStream()) - val stdOutErr = new PrintStream(System.out) + val stdOutErr = new PrintStream(new ByteArrayOutputStream()) +// val stdOutErr = new PrintStream(System.out) val stdIn = new ByteArrayInputStream(Array()) - val runner = new mill.main.MainRunner( + lazy val runner = new mill.main.MainRunner( ammonite.main.Cli.Config(wd = workspacePath), stdOutErr, stdOutErr, stdIn ) - def eval(s: String*) = runner.runScript(workspacePath / "build.sc", s.toList) + def eval(s: String*) = { + if (!fork) runner.runScript(workspacePath / "build.sc", s.toList) + else{ + try { + %%(home / "mill-release", s)(workspacePath) + true + }catch{case e: Throwable => false} + } + } def meta(s: String) = { val (List(selector), args) = ParseArgs.apply(Seq(s), multiSelect = false).right.get diff --git a/main/test/src/mill/util/TestEvaluator.scala b/main/test/src/mill/util/TestEvaluator.scala index 285aa659..a5be0488 100644 --- a/main/test/src/mill/util/TestEvaluator.scala +++ b/main/test/src/mill/util/TestEvaluator.scala @@ -28,8 +28,8 @@ class TestEvaluator[T <: TestUtil.BaseModule](module: T) tp: TestPath){ val outPath = TestUtil.getOutPath() -// val logger = DummyLogger - val logger = new PrintLogger(true, ammonite.util.Colors.Default, System.out, System.out, System.err) + val logger = DummyLogger +// val logger = new PrintLogger(true, ammonite.util.Colors.Default, System.out, System.out, System.err) val evaluator = new Evaluator(outPath, TestEvaluator.externalOutPath, module, discover, logger) def apply[T](t: Task[T]): Either[Result.Failing[T], (T, Int)] = { |