summaryrefslogtreecommitdiffstats
path: root/src/graph_test.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2012-07-28 16:56:55 (GMT)
committerNico Weber <nicolasweber@gmx.de>2012-07-28 16:56:55 (GMT)
commit3ab35e5403066f48117f442f9ba8853e70edab13 (patch)
treebbe59cc9e32a9e12585b7acbbae9d37fb6eec2df /src/graph_test.cc
parentb26f978ac3d7c5fd91de675bba62f31f704e0e04 (diff)
downloadNinja-3ab35e5403066f48117f442f9ba8853e70edab13.zip
Ninja-3ab35e5403066f48117f442f9ba8853e70edab13.tar.gz
Ninja-3ab35e5403066f48117f442f9ba8853e70edab13.tar.bz2
Add a regression test for issue #380 (which fails at the moment)
Diffstat (limited to 'src/graph_test.cc')
-rw-r--r--src/graph_test.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/graph_test.cc b/src/graph_test.cc
index 07a1936..38ff28a 100644
--- a/src/graph_test.cc
+++ b/src/graph_test.cc
@@ -140,3 +140,22 @@ TEST_F(GraphTest, VarInOutQuoteSpaces) {
EXPECT_EQ("cat nospace \"with space\" nospace2 > \"a b\"",
edge->EvaluateCommand());
}
+
+// Regression test for https://github.com/martine/ninja/issues/380
+TEST_F(GraphTest, DepfileWithCanonicalizablePath) {
+ ASSERT_NO_FATAL_FAILURE(AssertParse(&state_,
+"rule catdep\n"
+" depfile = $out.d\n"
+" command = cat $in > $out\n"
+"build ./out.o: catdep ./foo.cc\n"));
+ fs_.Create("foo.cc", 1, "");
+ fs_.Create("out.o.d", 1, "out.o: bar/../foo.cc\n");
+ fs_.Create("out.o", 1, "");
+
+ Edge* edge = GetNode("out.o")->in_edge();
+ string err;
+ EXPECT_TRUE(edge->RecomputeDirty(&state_, &fs_, &err));
+ ASSERT_EQ("", err);
+
+ EXPECT_FALSE(GetNode("out.o")->dirty());
+}