Skip to content

Instantly share code, notes, and snippets.

@iwadon
Created April 18, 2011 02:59
Show Gist options
  • Select an option

  • Save iwadon/924738 to your computer and use it in GitHub Desktop.

Select an option

Save iwadon/924738 to your computer and use it in GitHub Desktop.
diff of src/graph_test.cc
diff --git a/src/graph_test.cc b/src/graph_test.cc
index ba41440..56e8ab5 100644
--- a/src/graph_test.cc
+++ b/src/graph_test.cc
@@ -79,3 +79,21 @@ TEST_F(GraphTest, ExplicitImplicit) {
// the output to be dirty).
EXPECT_TRUE(GetNode("out.o")->dirty_);
}
+
+TEST_F(GraphTest, PathWithCurrentDirectory) {
+ 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: 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_);
+}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment