diff options
author | David Emett <dave@sp4m.net> | 2015-09-20 13:43:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-04-06 15:24:46 (GMT) |
commit | ff6eedb968ddd6f0f9ba252a31e5a77967edddb5 (patch) | |
tree | 586d8272ccfdbf2919329759aa9c6ee0a82eb5a0 | |
parent | 7d21426c56306917ebaf16671a75215672d79755 (diff) | |
download | Ninja-ff6eedb968ddd6f0f9ba252a31e5a77967edddb5.zip Ninja-ff6eedb968ddd6f0f9ba252a31e5a77967edddb5.tar.gz Ninja-ff6eedb968ddd6f0f9ba252a31e5a77967edddb5.tar.bz2 |
Add another test case covering pool release on edge failure
With this build file:
pool failpool
depth = 1
rule fail
command = fail
pool = failpool
build out1: fail
build out2: fail
build out3: fail
build final: phony out1 out2 out3
Running `ninja -k 0` should run out1..3 sequentially before failing, but
until recently we would fail after just running out1. Add a test
covering this case.
-rw-r--r-- | src/build_test.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/build_test.cc b/src/build_test.cc index 261268a..90d500c 100644 --- a/src/build_test.cc +++ b/src/build_test.cc @@ -1153,6 +1153,30 @@ TEST_F(BuildTest, SwallowFailuresLimit) { ASSERT_EQ("cannot make progress due to previous errors", err); } +TEST_F(BuildTest, SwallowFailuresPool) { + ASSERT_NO_FATAL_FAILURE(AssertParse(&state_, +"pool failpool\n" +" depth = 1\n" +"rule fail\n" +" command = fail\n" +" pool = failpool\n" +"build out1: fail\n" +"build out2: fail\n" +"build out3: fail\n" +"build final: cat out1 out2 out3\n")); + + // Swallow ten failures; we should stop before building final. + config_.failures_allowed = 11; + + string err; + EXPECT_TRUE(builder_.AddTarget("final", &err)); + ASSERT_EQ("", err); + + EXPECT_FALSE(builder_.Build(&err)); + ASSERT_EQ(3u, command_runner_.commands_ran_.size()); + ASSERT_EQ("cannot make progress due to previous errors", err); +} + TEST_F(BuildTest, PoolEdgesReadyButNotWanted) { fs_.Create("x", ""); |