mirror of https://github.com/sbt/sbt.git
Merge pull request #4226 from driquelme/fix_ctrl_c_forked_test
Fix CTRL-C exception
This commit is contained in:
commit
0c3a458e99
|
|
@ -258,9 +258,19 @@ final public class ForkMain {
|
||||||
final Task[] tasks = runner.tasks(filteredTests.toArray(new TaskDef[filteredTests.size()]));
|
final Task[] tasks = runner.tasks(filteredTests.toArray(new TaskDef[filteredTests.size()]));
|
||||||
logDebug(os, "Runner for " + framework.getClass().getName() + " produced " + tasks.length + " initial tasks for " + filteredTests.size() + " tests.");
|
logDebug(os, "Runner for " + framework.getClass().getName() + " produced " + tasks.length + " initial tasks for " + filteredTests.size() + " tests.");
|
||||||
|
|
||||||
|
Thread callDoneOnShutdown = new Thread() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
runner.done();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Runtime.getRuntime().addShutdownHook(callDoneOnShutdown);
|
||||||
|
|
||||||
runTestTasks(executor, tasks, loggers, os);
|
runTestTasks(executor, tasks, loggers, os);
|
||||||
|
|
||||||
runner.done();
|
runner.done();
|
||||||
|
|
||||||
|
Runtime.getRuntime().removeShutdownHook(callDoneOnShutdown);
|
||||||
}
|
}
|
||||||
write(os, ForkTags.Done);
|
write(os, ForkTags.Done);
|
||||||
is.readObject();
|
is.readObject();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue