summaryrefslogtreecommitdiffstats
path: root/src/test.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix building tests on Windows again.Nico Weber2014-09-181-5/+8
| | | | | | | 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-1/+3
| | | | | | | | | | | | | | | | | | | | | 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.
* make Stat() a const methodNico Weber2014-06-191-2/+2
|
* add a test for the "deps out of date" caseEvan Martin2013-04-091-1/+5
| | | | It touched the various remaining XXXes in the code, hooray.
* move test virtual time "now_" into VirtualFileSystemEvan Martin2013-04-081-3/+3
| | | | It's the only piece that cares about the current time.
* Rename parsers.* to manifest_parser.*Thiago Farina2012-07-091-1/+1
| | | | | | So it matches with the class name in there. Signed-off-by: Thiago Farina <tfarina@chromium.org>
* Only store command hashes in the build log.Nico Weber2012-06-151-0/+5
| | | | | | | | | | | | | | .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.
* Response filesunknown2012-02-091-0/+6
|
* windows: use _WIN32 define everywhereEvan Martin2012-01-221-1/+1
| | | | Rather than mixing use of WIN32 and _WIN32.
* GetTempPath() needs windows.hFrances Buontempo2012-01-111-0/+4
|
* migrate tempdir code to test.ccEvan Martin2012-01-061-0/+91
|
* convert all time_t to a new TimeStamp typeEvan Martin2012-01-051-1/+1
|
* Include <algorithm> for std::find in test.ccFrances Buontempo2012-01-031-0/+2
|
* switch the core ninja parser to use re2c for the lexerEvan Martin2011-12-291-1/+1
| | | | | | | | | - Delete the old "Tokenizer" code. - Write separate tests for the lexer distinct from the parser. - Switch the parser to use the new code. - New lexer error output has file:line numbers so e.g. Emacs can jump your editor to the syntax error. - The EvalEnv ($-interpolation) code is now part of the lexer as well.
* disable the 'unused parameter' warningEvan Martin2011-12-051-1/+1
| | | | It was firing too often, and hadn't uncovered any bugs.
* Fix compilation warning in Ninja's test suite.Nicolas Despres2011-11-211-1/+1
|
* Return non-zero status when errors occur.Nicolas Despres2011-05-021-3/+6
| | | | | | Clean all was not returning non-zero when an error occur (like when failing to remove a directory). This patch fix the problem and add a test for it.
* Add a test for the clean tool.Nicolas Despres2011-05-021-0/+11
| | | | It also fix a bug about the count of removed file reported.
* move VirtualFileSystem into test.*Evan Martin2011-03-061-0/+26
|
* move test support into test.*Evan Martin2011-03-061-0/+34