diff options
author | Nico Weber <thakis@chromium.org> | 2013-06-03 23:56:46 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2013-06-04 01:56:49 (GMT) |
commit | ca0f379c27aa4887dbc63e3af71a6ebc687649e0 (patch) | |
tree | b17b85ddc1963e0788b893d91a3c4862b080cd04 /src/build_test.cc | |
parent | 0f53fd302b58589626dce073a0cd94061fac1355 (diff) | |
download | Ninja-ca0f379c27aa4887dbc63e3af71a6ebc687649e0.zip Ninja-ca0f379c27aa4887dbc63e3af71a6ebc687649e0.tar.gz Ninja-ca0f379c27aa4887dbc63e3af71a6ebc687649e0.tar.bz2 |
Add test that proves `node->AddOutEdge(edge);` in `LoadDepFile()` is needed.
No functionality change. Related to issue #590.
Diffstat (limited to 'src/build_test.cc')
-rw-r--r-- | src/build_test.cc | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/build_test.cc b/src/build_test.cc index ed9ade3..5089607 100644 --- a/src/build_test.cc +++ b/src/build_test.cc @@ -1604,7 +1604,30 @@ TEST_F(BuildWithDepsLogTest, DepsIgnoredInDryRun) { } /// Check that a restat rule generating a header cancels compilations correctly. -TEST_F(BuildWithDepsLogTest, RestatDepfileDependency) { +TEST_F(BuildTest, RestatDepfileDependency) { + ASSERT_NO_FATAL_FAILURE(AssertParse(&state_, +"rule true\n" +" command = true\n" // Would be "write if out-of-date" in reality. +" restat = 1\n" +"build header.h: true header.in\n" +"build out: cat in1\n" +" depfile = in1.d\n")); + + fs_.Create("header.h", ""); + fs_.Create("in1.d", "out: header.h"); + fs_.Tick(); + fs_.Create("header.in", ""); + + string err; + EXPECT_TRUE(builder_.AddTarget("out", &err)); + ASSERT_EQ("", err); + EXPECT_TRUE(builder_.Build(&err)); + EXPECT_EQ("", err); +} + +/// Check that a restat rule generating a header cancels compilations correctly, +/// depslog case. +TEST_F(BuildWithDepsLogTest, RestatDepfileDependencyDepsLog) { string err; // Note: in1 was created by the superclass SetUp(). const char* manifest = |