diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2011-12-01 20:55:18 (GMT) |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2012-02-04 21:46:12 (GMT) |
commit | 44f58aeca923d6e3001636f8c0d24a6d513d8ea2 (patch) | |
tree | 9507856d2854532510f8a38fdc11c5f19f21554a /src/build_test.cc | |
parent | 85ff781fa30fff63c01ccd30faaad39d766e1505 (diff) | |
download | Ninja-44f58aeca923d6e3001636f8c0d24a6d513d8ea2.zip Ninja-44f58aeca923d6e3001636f8c0d24a6d513d8ea2.tar.gz Ninja-44f58aeca923d6e3001636f8c0d24a6d513d8ea2.tar.bz2 |
If a command fails, wait for all running commands to terminate before we do
Previously, if a command fails, the fate of the other child processes
running in parallel was inadequately controlled. On POSIX platforms,
the processes were orphaned. Normally they would run to completion,
but were liable to being killed by a SIGPIPE. On Windows, the child
processes would terminate with the parent. The cleanup-on-interrupt
patch caused the SubprocessSet and Builder destructors to clean
up after themselves by killing any running child processes and
deleting their output files, making the behaviour more predictable
and consistent across platforms.
If the build is interrupted by the user, this is correct behaviour.
But in the case where the build is stopped by a failed command, this
would be inconsistent with user expectations. In the latter case,
we now let any remaining child processes run to completion before
leaving the main loop in Builder::Build.
Diffstat (limited to 'src/build_test.cc')
-rw-r--r-- | src/build_test.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/build_test.cc b/src/build_test.cc index de5ddc1..7c3a729 100644 --- a/src/build_test.cc +++ b/src/build_test.cc @@ -661,7 +661,7 @@ TEST_F(BuildTest, SwallowFailures) { "build all: phony out1 out2 out3\n")); // Swallow two failures, die on the third. - config_.swallow_failures = 2; + config_.failures_allowed = 3; string err; EXPECT_TRUE(builder_.AddTarget("all", &err)); @@ -682,7 +682,7 @@ TEST_F(BuildTest, SwallowFailuresLimit) { "build final: cat out1 out2 out3\n")); // Swallow ten failures; we should stop before building final. - config_.swallow_failures = 10; + config_.failures_allowed = 11; string err; EXPECT_TRUE(builder_.AddTarget("final", &err)); |