summaryrefslogtreecommitdiffstats
path: root/src/build_log_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* Always rebuild on errorsColin Cross2017-05-221-4/+4
| | | | | | | | | | 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.
* ninja_test: Fix Visual C++ 2015 warnings/errors about name hiding.James Johnston2016-04-181-7/+9
| | | | | | | | | Visual C++ 2015 warns if a local variable hides visibility of another variable in a higher scope. Since this project declares warnings as errors, ninja_test simply won't build on Visual C++ 2015. The variables have been renamed and scope limited as appropriate, so that ninja_test will build without error now on Visual C++ 2015.
* Remove 'Recompacting...' messages.Nico Weber2014-12-181-1/+0
| | | | | | | | | | Recompacting the build log used to be slow, so it made sense to print this message. We then made recompaction much faster, but didn't remove this message back then. The deps log only has it because the build log had it. Since both steps are effectively instant in practice, remove these log messages.
* Don't print "Recompacting..." message from tests.Nico Weber2014-09-191-0/+1
| | | | Now tests don't print anything. Non-test behavior is unchanged.
* Fix building tests on Windows again.Nico Weber2014-09-181-1/+1
| | | | | | | Turns out gtest was pulling in sys/stat.h, and we were using stat() through that in tests. This doesn't work with old MSVCs, so we should probably replace that with RealDiskInterface in a follow-up.
* Make BuildLogUser reference constant.Nico Weber2014-01-071-2/+2
|
* Rename "IsDead" to "BuildLogUser".Nico Weber2014-01-041-8/+8
|
* Add a test for collection of dead log entries.Nico Weber2014-01-041-0/+40
|
* Make tests compile (one fails atm).Nico Weber2014-01-021-6/+7
|
* Introduce a Truncate() function that works on POSIX and Windows.Nico Weber2013-04-291-9/+1
| | | | Hopefully fixes the build on Windows.
* wrap some overlong linesEvan Martin2012-12-291-1/+2
|
* wrap test in anon namespaceEvan Martin2012-12-281-0/+4
|
* build log: Adding test for multiple target edgesMaxim Kalaev2012-10-121-0/+20
|
* Merge pull request #408 from nico/fixEvan Martin2012-09-061-0/+2
|\ | | | | Make sure no stale test file exists before running build log tests.
| * Make sure no stale test file exists before running build log tests.Nico Weber2012-09-011-0/+2
| |
* | remove config from BuildLog, rename membersEvan Martin2012-09-021-2/+2
|/
* fix test broken in 697350dEvan Martin2012-08-171-2/+10
| | | | That's what I get for making last-second adjustments before checking in!
* make it more explicit that a bad build log causes us to rebuildEvan Martin2012-08-171-1/+1
| | | | | (Committing this on top of b56fe80 since they're related, but I may end up reverting both.)
* Include unistd.h in files that use unlink() on OS X.Nico Weber2012-08-051-3/+1
| | | | | | | | `man unlink` says this is necessary, and according to a report by Claus Klein, omitting them breaks the build on OS X 10.5 with gcc 4.7 (see issue #396). (On Windows, ninja's util.h includes a define for unlink.)
* make the build log test match the indended build log logicEvan Martin2012-07-271-3/+3
| | | | | | | | | As described on https://github.com/martine/ninja/pull/349 , this test shouldn't have been passing. Fixing a Valgrind issue showed that the test was wrong. Thankfully it wasn't a critical issue. The new code verifies that we either succeed or report an error when parsing -- the only behavior we really care about is not crashing.
* drop support of log formats < 4Evan Martin2012-06-181-13/+6
| | | | | Log format 4 was introduced in January. There's been plenty of time to migrate.
* Only store command hashes in the build log.Nico Weber2012-06-151-6/+6
| | | | | | | | | | | | | | .build_log load time 350ms -> 17ms, filesize 197MB -> 1.6MB on Mac. On Windows, it's 500ms -> 20ms. Makes the build log a lot less useful for scripts, but there could be a tool for use cases that need log information. A prototype of such a tool is in https://github.com/nico/ninja/commit/1b243d311 The hash function is 64bit murmurhash2. Assuming that that different commands get the same hash only by chance, it's is very unlikely for two different commands to hash to the same value with a 64bit hash.
* Add a BuildLog test that checks that very long command liens don't crash.Nico Weber2012-05-101-0/+28
|
* Add a BuildLog test that checks duplicate version headers don't crash.Nico Weber2012-05-101-0/+31
|
* Add a BuildLog loading perftest.Nico Weber2012-05-081-1/+1
|
* Don't write ninja log header to log on every build on Windows.Nico Weber2012-05-081-0/+31
|
* Make |log_| variable private to BuildLog.Evan Martin2012-04-051-2/+2
| | | | | | This fix the TODO in build_log.h file. Signed-off-by: Thiago Farina <tfarina@chromium.org>
* windows: use _WIN32 define everywhereEvan Martin2012-01-221-2/+2
| | | | Rather than mixing use of WIN32 and _WIN32.
* make my last change actually workEvan Martin2012-01-051-5/+6
|
* Switch build log to use tabs as field separators, to support outputs with ↵Nico Weber2012-01-051-0/+19
| | | | spaces.
* Implement restat rulesPeter Collingbourne2011-10-241-0/+19
| | | | | | | | | | | | | | | | | A restat rule is a rule which is capable of pruning the build tree depending on the timestamps of its outputs before and after a build. After a restat rule is rebuilt, Ninja will re-stat each output file to obtain its current timestamp. If the timestamp is unchanged from when Ninja initially stat'ed the file before starting the build, Ninja will mark that output file as clean, and recursively for each reverse dependency of the output file, recompute its dirty status. Ninja then stores the most recent timestamp of any input file in the build log entry associated with the output file. This timestamp will be treated by future invocations of Ninja as the output file's modification time instead of the output file's actual modification time for the purpose of deciding whether it is dirty (but not whether its reverse dependencies are dirty).
* build_log_test.cc: add 3 #include for stat(2) on LinuxQingning Huo2011-06-101-0/+6
|
* remove +x bit from sourceEvan Martin2011-06-031-0/+0
|
* mingw ninja_test links and passes. (as do linux and native VS2010)Philip Craig2011-05-291-2/+3
| | | | | | Use chsize instead of truncate for mingw compatibility SubprocessTest uses DoWork to force Subprocesses to execute Drop GoodCommandStdOut test as it is tested in SetWithSingle
* Tests now build on a native Windows build (tested with VS2010)Philip Craig2011-05-281-0/+11
| | | | | All tests except SubProcess pass on a native Windows build Tests continue not to build on a platform=mingw build
* don't crash on truncated log filesEvan Martin2011-05-111-0/+28
| | | | | Add a test that tries all truncations of a log file and verifies it doesn't crash.
* add a versioning header to build log, switch to v2Evan Martin2011-05-111-3/+3
| | | | | In v2 we store both the start and end time of the command. This allows better visualization of the build process.
* windows: successfully link testsEvan Martin2011-05-061-2/+2
| | | | | It links, with some hacks. Tests still fail.
* add copyrightsEvan Martin2011-02-061-0/+14
|
* remove tempnamEvan Martin2011-01-091-8/+7
|
* work around mktemp warningEvan Martin2011-01-081-2/+1
|
* later entry in build log should overwrite earlier oneEvan Martin2011-01-071-0/+16
|
* add a class for logging builds (commands + timing)Evan Martin2010-12-231-0/+43