diff options
author | Nico Weber <nicolasweber@gmx.de> | 2014-01-02 05:37:47 (GMT) |
---|---|---|
committer | Nico Weber <nicolasweber@gmx.de> | 2014-01-02 05:37:47 (GMT) |
commit | 7a5fc52601d6e1db5786e0a83d7cc93e2d32a097 (patch) | |
tree | 1288b8597d4350af730caf348595df526a6825ff /src/deps_log_test.cc | |
parent | 4ecc34493fdebeea25f7ddf4392282b8adf39f05 (diff) | |
download | Ninja-7a5fc52601d6e1db5786e0a83d7cc93e2d32a097.zip Ninja-7a5fc52601d6e1db5786e0a83d7cc93e2d32a097.tar.gz Ninja-7a5fc52601d6e1db5786e0a83d7cc93e2d32a097.tar.bz2 |
Fix DepsLogTest.Recompact by making sure outputs aren't garbag-collected.
Diffstat (limited to 'src/deps_log_test.cc')
-rw-r--r-- | src/deps_log_test.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/deps_log_test.cc b/src/deps_log_test.cc index 4e6cbac..3304edb 100644 --- a/src/deps_log_test.cc +++ b/src/deps_log_test.cc @@ -163,10 +163,18 @@ TEST_F(DepsLogTest, DoubleEntry) { // Verify that adding the new deps works and can be compacted away. TEST_F(DepsLogTest, Recompact) { + const char kManifest[] = +"rule cc\n" +" command = cc\n" +" deps = gcc\n" +"build out.o: cc\n" +"build other_out.o: cc\n"; + // Write some deps to the file and grab its size. int file_size; { State state; + ASSERT_NO_FATAL_FAILURE(AssertParse(&state, kManifest)); DepsLog log; string err; ASSERT_TRUE(log.OpenForWrite(kTestFilename, &err)); @@ -194,6 +202,7 @@ TEST_F(DepsLogTest, Recompact) { int file_size_2; { State state; + ASSERT_NO_FATAL_FAILURE(AssertParse(&state, kManifest)); DepsLog log; string err; ASSERT_TRUE(log.Load(kTestFilename, &state, &err)); @@ -217,6 +226,7 @@ TEST_F(DepsLogTest, Recompact) { // recompact. { State state; + ASSERT_NO_FATAL_FAILURE(AssertParse(&state, kManifest)); DepsLog log; string err; ASSERT_TRUE(log.Load(kTestFilename, &state, &err)); |