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()]));
|
||||
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);
|
||||
|
||||
runner.done();
|
||||
|
||||
Runtime.getRuntime().removeShutdownHook(callDoneOnShutdown);
|
||||
}
|
||||
write(os, ForkTags.Done);
|
||||
is.readObject();
|
||||
|
|
|
|||
Loading…
Reference in New Issue