diff options
author | Scott Graham <scottmg@chromium.org> | 2014-11-09 07:32:21 (GMT) |
---|---|---|
committer | Scott Graham <scottmg@chromium.org> | 2014-11-09 07:32:21 (GMT) |
commit | b01bd31b2576c53114a27426c07c33879e1ee9f2 (patch) | |
tree | 3ee094dff1c2b20b8a11520fd6229c5fdf946b5e /src | |
parent | bbeee64de290de274703c64b81d3704bd0a503e0 (diff) | |
download | Ninja-b01bd31b2576c53114a27426c07c33879e1ee9f2.zip Ninja-b01bd31b2576c53114a27426c07c33879e1ee9f2.tar.gz Ninja-b01bd31b2576c53114a27426c07c33879e1ee9f2.tar.bz2 |
improve test
Diffstat (limited to 'src')
-rw-r--r-- | src/build_test.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/build_test.cc b/src/build_test.cc index f25dd5f..912e3ef 100644 --- a/src/build_test.cc +++ b/src/build_test.cc @@ -943,17 +943,19 @@ TEST_F(BuildTest, DepFileCanonicalize) { int orig_edges = state_.edges_.size(); ASSERT_NO_FATAL_FAILURE(AssertParse(&state_, "rule cc\n command = cc $in\n depfile = $out.d\n" -"build gen/stuff/foo.o: cc foo.c\n")); +"build gen/stuff\\things/foo.o: cc x\\y/z\\foo.c\n")); Edge* edge = state_.edges_.back(); - fs_.Create("foo.c", ""); + fs_.Create("x/y/z/foo.c", ""); GetNode("bar.h")->MarkDirty(); // Mark bar.h as missing. // Note, different slashes from manifest. - fs_.Create("gen/stuff/foo.o.d", "gen\\stuff\\foo.o: blah.h bar.h\n"); - EXPECT_TRUE(builder_.AddTarget("gen/stuff/foo.o", &err)); + fs_.Create("gen/stuff\\things/foo.o.d", + "gen\\stuff\\things\\foo.o: blah.h bar.h\n"); + EXPECT_TRUE(builder_.AddTarget("gen/stuff/things/foo.o", &err)); ASSERT_EQ("", err); ASSERT_EQ(1u, fs_.files_read_.size()); - EXPECT_EQ("gen/stuff/foo.o.d", fs_.files_read_[0]); + // The depfile path does not get Canonicalize as it seems unnecessary. + EXPECT_EQ("gen/stuff\\things/foo.o.d", fs_.files_read_[0]); // Expect three new edges: one generating foo.o, and two more from // loading the depfile. @@ -961,8 +963,9 @@ TEST_F(BuildTest, DepFileCanonicalize) { // Expect our edge to now have three inputs: foo.c and two headers. ASSERT_EQ(3u, edge->inputs_.size()); - // Expect the command line we generate to only use the original input. - ASSERT_EQ("cc foo.c", edge->EvaluateCommand()); + // Expect the command line we generate to only use the original input, and + // using the slashes from the manifest. + ASSERT_EQ("cc x\\y/z\\foo.c", edge->EvaluateCommand()); } #endif |