diff options
author | Colin Cross <ccross@android.com> | 2017-05-19 00:34:51 (GMT) |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2017-05-22 18:29:06 (GMT) |
commit | 04d886b11041bb59d01df794cce7a1e8cad2250d (patch) | |
tree | e56630542064e75e205e85bd97dfd4f6fc693bcd /src/build_test.cc | |
parent | a127dda3ee92916ef459b3da7aa9f2920ff1a5ab (diff) | |
download | Ninja-04d886b11041bb59d01df794cce7a1e8cad2250d.zip Ninja-04d886b11041bb59d01df794cce7a1e8cad2250d.tar.gz Ninja-04d886b11041bb59d01df794cce7a1e8cad2250d.tar.bz2 |
Always rebuild on errors
https://groups.google.com/forum/#!msg/ninja-build/YQuGNrECI-4/ti-lAs9SPv8J
discusses a case where an rule updates its output file and then
fails. The next run of ninja considers the ouptut file clean
and doesn't rebuild it. Always stat output files after they are
built, and write the mtime into .ninja_log. Consider output files
dirty if the recorded mtime is older than the most recent input
file.
Diffstat (limited to 'src/build_test.cc')
-rw-r--r-- | src/build_test.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/build_test.cc b/src/build_test.cc index d617143..0eb9aaa 100644 --- a/src/build_test.cc +++ b/src/build_test.cc @@ -1485,7 +1485,7 @@ TEST_F(BuildWithLogTest, RestatMissingInput) { // the right mtime BuildLog::LogEntry* log_entry = build_log_.LookupByOutput("out1"); ASSERT_TRUE(NULL != log_entry); - ASSERT_EQ(restat_mtime, log_entry->restat_mtime); + ASSERT_EQ(restat_mtime, log_entry->mtime); // Now remove a file, referenced from depfile, so that target becomes // dirty, but the output does not change @@ -1502,7 +1502,7 @@ TEST_F(BuildWithLogTest, RestatMissingInput) { // Check that the logfile entry remains correctly set log_entry = build_log_.LookupByOutput("out1"); ASSERT_TRUE(NULL != log_entry); - ASSERT_EQ(restat_mtime, log_entry->restat_mtime); + ASSERT_EQ(restat_mtime, log_entry->mtime); } struct BuildDryRun : public BuildWithLogTest { |