diff options
author | Maxim Kalaev <maximk@il.ibm.com> | 2012-10-06 21:16:21 (GMT) |
---|---|---|
committer | Maxim Kalaev <maximk@il.ibm.com> | 2012-10-12 07:16:36 (GMT) |
commit | 17399ca4e5c0de7e64036c46cae616c86317e51f (patch) | |
tree | c80fd5c6695c5f752f11c5a61f0757b36a423d6c /src | |
parent | 6b1d5c259009ab576524af707ee01b10361a5512 (diff) | |
download | Ninja-17399ca4e5c0de7e64036c46cae616c86317e51f.zip Ninja-17399ca4e5c0de7e64036c46cae616c86317e51f.tar.gz Ninja-17399ca4e5c0de7e64036c46cae616c86317e51f.tar.bz2 |
build log: Adding test for multiple target edges
Diffstat (limited to 'src')
-rw-r--r-- | src/build_log_test.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/build_log_test.cc b/src/build_log_test.cc index a6c2a86..5275f25 100644 --- a/src/build_log_test.cc +++ b/src/build_log_test.cc @@ -245,3 +245,23 @@ TEST_F(BuildLogTest, VeryLongInputLine) { ASSERT_EQ(789, e->restat_mtime); ASSERT_NO_FATAL_FAILURE(AssertHash("command2", e->command_hash)); } + +TEST_F(BuildLogTest, MultiTargetEdge) { + AssertParse(&state_, +"build out out.d: cat\n"); + + BuildLog log; + log.RecordCommand(state_.edges_[0], 21, 22); + + ASSERT_EQ(2u, log.entries().size()); + BuildLog::LogEntry* e1 = log.LookupByOutput("out"); + ASSERT_TRUE(e1); + BuildLog::LogEntry* e2 = log.LookupByOutput("out.d"); + ASSERT_TRUE(e2); + ASSERT_EQ("out", e1->output); + ASSERT_EQ("out.d", e2->output); + ASSERT_EQ(21, e1->start_time); + ASSERT_EQ(21, e2->start_time); + ASSERT_EQ(22, e2->end_time); + ASSERT_EQ(22, e2->end_time); +} |