summaryrefslogtreecommitdiffstats
path: root/src/test.h
Commit message (Collapse)AuthorAgeFilesLines
* Comply with project formatting rules wrt 80 column linesMichael Jones2020-09-301-1/+2
|
* Remove 'using namespace std' from header files, properly namespace all std ↵Michael Jones2020-09-301-17/+17
| | | | symbols
* Misc typo fixes by https://github.com/codespell-project/codespell/Mo Zhou2018-09-061-1/+1
|
* Factor ManifestParser options into a structureBrad King2017-09-071-1/+3
| | | | | | This will allow more options to be added without updating everywhere that constructs a ManifestParser. Also extend the AssertParse function to take the options so tests can control them.
* ninja_test: Fix Visual C++ 2015 warnings/errors about name hiding.James Johnston2016-04-181-8/+8
| | | | | | | | | 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.
* Expose more details in FileReader::ReadFile signatureBrad King2016-02-031-1/+1
| | | | | | Return a status so callers can distinguish a missing file from an empty file. This allows our VirtualFileSystem test infrastructure to report as missing any file for which it has no entry.
* Let Stat() have an err outparam instead of writing to stderr.Nico Weber2015-03-311-1/+2
| | | | | | | | | Also check for Stat() failure in a few more places. This way, ninja doesn't print two "ninja: error: " lines if stat() fails during a build. It also makes it easier to keep the stat tests quiet. Every caller of Stat() needs to explicitly log the error string if that's desired.
* Build self-consistent graphs for dupe edges with multiple outputs.Nico Weber2015-03-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | Fixes #867, both the crashes and "[stuck]" issues. The problem was that a duplicate edge would modify the in_edge of the outputs of the new build rule, but the edge corresponding to the old build rule would still think that the in_edge points to itself. `old_edge->outputs_[0]->in_edge()` would not return `old_edge`, which confused the scan logic. As fix, let `State::AddOut()` reject changing in_edge if it's already set. This changes behavior in a minor way: Previously, if there were multiple edges for a single output, the last edge would be kept. Now, the first edge is kept. This only had mostly-well-defined semantics if all duplicate edges are the same (which is the only case I've seen in practice), and for that case the behavior doesn't change. For testing, add a VerifyGraph() function and call that every time any test graph is parsed. That's a bit more code than just copying the test cases from the bug into build_test.cc, but it also yields better test coverage overall.
* Add support for --gtest_filter. The bots need it, and it is a useful flag.Nico Weber2014-09-181-4/+2
|
* Use a small, standalone testing framework instead of googletest.Nico Weber2014-09-181-2/+86
| | | | | | | | | | | | | | | | | | | | | 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-1/+1
|
* add a test for the "deps out of date" caseEvan Martin2013-04-091-0/+6
| | | | It touched the various remaining XXXes in the code, hooray.
* move test virtual time "now_" into VirtualFileSystemEvan Martin2013-04-081-2/+13
| | | | It's the only piece that cares about the current time.
* Only store command hashes in the build log.Nico Weber2012-06-151-0/+1
| | | | | | | | | | | | | | .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/+2
|
* Stop warning about chdir etc which are treated as errors on MSVC with theFrances Buontempo2012-01-161-0/+1
| | | | current settings
* migrate tempdir code to test.ccEvan Martin2012-01-061-0/+13
|
* convert all time_t to a new TimeStamp typeEvan Martin2012-01-051-1/+1
|
* Factor out State struct from ninja_jumble.cc into its header/source files.Thiago Farina2011-09-031-1/+1
| | | | | | This was a TODO in src/ninja_jumble.cc. Now this task is completed. Signed-off-by: Thiago Farina <tfarina@chromium.org>
* Fix ninja compilation by including a missing disk_interface.h.Thiago Farina2011-08-251-0/+1
| | | | | | | When running ./ninja the compilation fails because test.h uses DiskInterface but doesn't include disk_interface.h to get the declaration. Signed-off-by: Thiago Farina <tfarina@chromium.org>
* Return non-zero status when errors occur.Nicolas Despres2011-05-021-1/+1
| | | | | | 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/+2
| | | | It also fix a bug about the count of removed file reported.
* add doxygen-compatibile comments to most classesEvan Martin2011-04-291-6/+7
|
* Add missing CPP guards.Nicolas Despres2011-03-221-0/+5
|
* more commentsEvan Martin2011-03-061-0/+2
|
* move VirtualFileSystem into test.*Evan Martin2011-03-061-0/+23
|
* move test support into test.*Evan Martin2011-03-061-1/+4
|
* add copyrightsEvan Martin2011-02-061-0/+14
|
* remove ResetDirtyEvan Martin2011-01-081-3/+0
|
* remove bottom-up dirtyingEvan Martin2011-01-081-0/+3
|
* split out graph into its own headerEvan Martin2011-01-081-2/+3
|
* move src into subdirEvan Martin2010-12-051-0/+12