Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 3ab35e5

Browse files
committed
Add a regression test for issue ninja-build#380 (which fails at the moment)
1 parent b26f978 commit 3ab35e5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/graph_test.cc

+19
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,22 @@ TEST_F(GraphTest, VarInOutQuoteSpaces) {
140140
EXPECT_EQ("cat nospace \"with space\" nospace2 > \"a b\"",
141141
edge->EvaluateCommand());
142142
}
143+
144+
// Regression test for https://github.com/martine/ninja/issues/380
145+
TEST_F(GraphTest, DepfileWithCanonicalizablePath) {
146+
ASSERT_NO_FATAL_FAILURE(AssertParse(&state_,
147+
"rule catdep\n"
148+
" depfile = $out.d\n"
149+
" command = cat $in > $out\n"
150+
"build ./out.o: catdep ./foo.cc\n"));
151+
fs_.Create("foo.cc", 1, "");
152+
fs_.Create("out.o.d", 1, "out.o: bar/../foo.cc\n");
153+
fs_.Create("out.o", 1, "");
154+
155+
Edge* edge = GetNode("out.o")->in_edge();
156+
string err;
157+
EXPECT_TRUE(edge->RecomputeDirty(&state_, &fs_, &err));
158+
ASSERT_EQ("", err);
159+
160+
EXPECT_FALSE(GetNode("out.o")->dirty());
161+
}

0 commit comments

Comments
 (0)