diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-05-19 09:37:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-19 09:37:25 -0700 |
commit | a7cb99f1bce04366f688d36bc9faef30161da8e7 (patch) | |
tree | 8e4d03449536bd0400f454c863fc3031c4f02f7b /main/test | |
parent | b03cf740533810e95774c079c76788d7ad61d8a2 (diff) | |
download | mill-a7cb99f1bce04366f688d36bc9faef30161da8e7.tar.gz mill-a7cb99f1bce04366f688d36bc9faef30161da8e7.tar.bz2 mill-a7cb99f1bce04366f688d36bc9faef30161da8e7.zip |
WIP keep mill server alive if you Ctrl-C during --watch (#339)
* wip
* Clean up more resources in the Mill client after every command
* catch and ignore SIGINT in Mill server to make it survive Ctrl-C on the client
Diffstat (limited to 'main/test')
-rw-r--r-- | main/test/src/mill/main/ClientServerTests.scala | 7 | ||||
-rw-r--r-- | main/test/src/mill/util/ScriptTestSuite.scala | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/main/test/src/mill/main/ClientServerTests.scala b/main/test/src/mill/main/ClientServerTests.scala index 7ed826af..2462f650 100644 --- a/main/test/src/mill/main/ClientServerTests.scala +++ b/main/test/src/mill/main/ClientServerTests.scala @@ -6,14 +6,15 @@ import mill.main.client.{Util, Locks} import scala.collection.JavaConverters._ import utest._ -class EchoServer extends ServerMain[Int]{ +class EchoServer extends MillServerMain[Int]{ def main0(args: Array[String], stateCache: Option[Int], mainInteractive: Boolean, stdin: InputStream, stdout: PrintStream, stderr: PrintStream, - env: Map[String, String]) = { + env: Map[String, String], + setIdle: Boolean => Unit) = { val reader = new BufferedReader(new InputStreamReader(stdin)) val str = reader.readLine() @@ -60,7 +61,7 @@ object ClientServerTests extends TestSuite{ (env : Map[String, String], args: Array[String]) = { val (in, out, err) = initStreams() Server.lockBlock(locks.clientLock){ - mill.main.client.Main.run( + mill.main.client.MillClientMain.run( tmpDir.toString, () => spawnEchoServer(tmpDir, locks), locks, diff --git a/main/test/src/mill/util/ScriptTestSuite.scala b/main/test/src/mill/util/ScriptTestSuite.scala index e9f31ce3..a23b34fe 100644 --- a/main/test/src/mill/util/ScriptTestSuite.scala +++ b/main/test/src/mill/util/ScriptTestSuite.scala @@ -16,7 +16,8 @@ abstract class ScriptTestSuite(fork: Boolean) extends TestSuite{ val stdIn = new ByteArrayInputStream(Array()) lazy val runner = new mill.main.MainRunner( ammonite.main.Cli.Config(wd = wd), - stdOutErr, stdOutErr, stdIn, None, Map.empty + stdOutErr, stdOutErr, stdIn, None, Map.empty, + b => () ) def eval(s: String*) = { if (!fork) runner.runScript(workspacePath / buildPath , s.toList) |