summaryrefslogtreecommitdiffstats
path: root/src/deps_log_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* ninja_test: Fix Visual C++ 2015 warnings/errors about name hiding.James Johnston2016-04-181-4/+6
| | | | | | | | | 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-2/+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.
* make all GetNode explicit, add DepsLog canonicalize testScott Graham2014-11-101-47/+47
|
* Don't print "Recompacting..." message from tests.Nico Weber2014-09-191-0/+2
| | | | 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.
* Use a small, standalone testing framework instead of googletest.Nico Weber2014-09-181-0/+5
| | | | | | | | | | | | | | | | | | | | | Ninja currently uses googletest for testing. That makes building ninja_test somewhat annoying since it requires that one passes --with-gtest PATH to configure. It turns out just implementing the bits of googletest that ninja uses needs about the same amount of code than making the --with-gtest flag in configure.py work and making googletest print test results in a way we want (!) In addition to making configuration simpler, this also makes compiling tests much faster: On my system, touching src/build_test.cc (the slowest file to build in ninja) and rebuilding ninja_tests is twice as fast than without this patch. Building all is noticeably faster too: 5.6s with this patch, 9.1s without this patch (38% faster). The most noticeable things missing: EXPECT_* and ASSERT_* don't support streaming notes to them with operator<<, and for failing tests the lhs and rhs are not printed. That's so that this header does not have to include sstream, which slows down building ninja_test almost 20%. If this turns out to be annoying, we can maybe add it.
* Add a test for collection of dead deps entries.Nico Weber2014-01-031-1/+46
|
* Fix DepsLogTest.Recompact by making sure outputs aren't garbag-collected.Nico Weber2014-01-021-0/+10
|
* Fix an issue with more than 64k deps, spotted by maximuska.Nico Weber2013-08-281-0/+33
| | | | Also add a test for this case, which would have spotted the issue too.
* fix truncate compile error in ninja_test on windowsScott Graham2013-05-171-1/+2
|
* Keep a DepsLog's data valid after a call to DepsLog::Recompact().Nico Weber2013-05-011-2/+27
| | | | | | Previously, a DepsLog would become invalid after Recompact() was called, due to Recompact() making all node ids refer to a temporary DepsLog object constructed in Recompact().
* Let DepsLog::RecordDeps() update its in-memory representation.Nico Weber2013-04-301-8/+14
| | | | | | This is a behavior change, but it should be safe: Graph only queries the deps log at startup, before running any command. Nothing else currently queries the deps log.
* Merge pull request #558 from nico/buildfixEvan Martin2013-04-291-2/+2
|\ | | | | Introduce a Truncate() function that works on POSIX and Windows.
| * Introduce a Truncate() function that works on POSIX and Windows.Nico Weber2013-04-291-2/+2
| | | | | | | | Hopefully fixes the build on Windows.
* | Don't crash during deps log recompaction if there's more than one deps entry.Nico Weber2013-04-291-0/+6
|/ | | | Part of issue #554.
* deps log: recover on truncated entryEvan Martin2013-04-271-3/+68
| | | | | | If a read fails while reading an entry, truncate the log to the last successfully read entry. This prevents corruption when a subsequent run appends another entry.
* add a test for truncated depsEvan Martin2013-04-261-0/+60
| | | | | This doesn't yet exhibit the full problems with truncation, but it's a start.
* make DepsLogTest actually clean up on teardownEvan Martin2013-04-261-1/+1
| | | | | I think I commented this out when tracking down a bug and forgot to uncomment it.
* fix typo in commentNico Weber2013-04-091-1/+1
|
* On invalid depslog header, restart build instead of showing an error.Nico Weber2013-04-091-0/+26
| | | | Also add tests for invalid headers.
* add recompaction to depslogEvan Martin2013-04-081-0/+70
| | | | Not done automatically yet, just an implementation and a test.
* don't write out deps entries if nothing changedEvan Martin2013-04-081-0/+46
| | | | Shortcuts a common case.
* expand DepsLog test, fix two bugs it revealedEvan Martin2013-04-081-11/+27
|
* add DepsLog, a new data structure for dependency informationEvan Martin2013-04-081-0/+63
DepsLog is a compact serialization of dependency information. It can be used to replace depfiles for faster loading.