summaryrefslogtreecommitdiffstats
path: root/src/build_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* make all GetNode explicit, add DepsLog canonicalize testScott Graham2014-11-101-1/+67
|
* improve testScott Graham2014-11-091-7/+10
|
* remove CanonicalizePath overloads, test for toplevel behaviourScott Graham2014-11-091-0/+29
|
* path decanonicalization when building commandScott Graham2014-11-081-2/+1
|
* CanonicalizePath handles \ on WindowsScott Graham2014-10-301-5/+1
|
* 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 "depfile=$out.d" work if $out contains escaped characters, rspfile too.Nico Weber2014-05-211-17/+28
| | | | | | | | | | | | | | Fixes #730. This has always been broken, but due to #690 more paths are now escaped (e.g. paths containing + characters, like file.c++). Also see discussion in #689. The approach is to give EdgeEnv an enum deciding on whether or not to escape file names, and provide functions that evaluate depfile and rspfile with that set that to kNoEscape. (depfile=$out.d doesn't make sense on edges with multiple outputs.) This should be relatively safe, as $in and $out can't be used on edges, only on rules (#687).
* win console wip: enable testNico Weber2014-05-131-4/+2
|
* Introduce the "console" poolPeter Collingbourne2014-02-031-10/+54
| | | | | | | This is a pre-defined pool with a depth of 1. It has the special property that any task in the pool has direct access to the console. This can be useful for interactive tasks or long-running tasks which produce status updates on the console (such as test suites).
* Make BuildLogUser reference constant.Nico Weber2014-01-071-1/+1
|
* Rename "IsDead" to "BuildLogUser".Nico Weber2014-01-041-2/+2
|
* Make tests compile (one fails atm).Nico Weber2014-01-021-2/+4
|
* Simplify.Nico Weber2013-09-081-3/+2
|
* Fix for build test for BuildWithDepsLogTest.RestatMissingDepfileDepslogRichard Geary2013-09-071-1/+4
|
* Fix restat rebuild if deps are missing.Maxim Kalaev2013-09-021-1/+117
| | | | | | | | | | | | Fixes issue #603. Apparently, the problem was caused by my fix r "consider target dirty if depfile is missing" (bcc8ad1), which was not working correctly with restat rules cleaning nodes. Switching to deps only triggered an easily observable issue. Fix by setting a flag in edges with invalid deps, and not cleaning edges with that flag set.
* Minor style fixes, no behavior change.Nico Weber2013-08-231-2/+2
|
* Add a test for issue #638.Nico Weber2013-08-221-0/+1
|
* Add test for correct restat logicChris Hopman2013-07-201-0/+40
| | | | | When a single output of an edge is dirty, the restat check should leave all outputs of that edge dirty.
* Add a test for CreatePhonyInEdge() in depsmode path.Nico Weber2013-06-061-0/+61
| | | | | | Removing the `CreatePhonyInEdge(node);` line in `ImplicitDepLoader::LoadDepsFromLog()` made no tests fail before this change. The new test is a port to depsmode of the existing DepFileOK test.
* Add test that proves `node->AddOutEdge(edge);` in `LoadDepFile()` is needed.Nico Weber2013-06-041-1/+24
| | | | No functionality change. Related to issue #590.
* Fix restat builds with edges generating headers depended on through deps filesNico Weber2013-06-031-0/+64
| | | | | | | | | | | | | in deps mode. `ImplicitDepLoader::LoadDepFile()` already adds a depfile edge from every file mentioned in a depfile to the depfile's output. `ImplicitDepLoader::LoadDepsFromLog()` didn't do this yet, so add it. Else, if a restat rule clears a generated .h file, this wouldn't propagate to cc files depending on that .h file through a depfile. Fixues issue #590.
* Fix Pool tests.Robert Iannucci2013-05-061-18/+37
| | | | | | | At any phase in the test where multiple edges are ready simultaneously, acquire all edges and sort them into a predictable order. This allows the test to execute deterministically regardless of the order of edge allocation.
* Don't record deps in dry runs.Nico Weber2013-04-221-1/+30
| | | | | | | deps_log() is NULL during dry runs, so this fixes a crash. It also matches ninja 1.2.0's behavior as far as I can tell. Fixes issue #551.
* Merge pull request #541 from sgraham/fix-vs2012Evan Martin2013-04-131-2/+2
|\ | | | | try again on vs2012 build fixes
| * try again on vs2012 build fixesScott Graham2013-04-111-2/+2
| |
* | fix testEvan Martin2013-04-111-14/+14
|/ | | | | I intentionally changed the semantics of the code that affected this test, but didn't update the test. Oops.
* add a straightforward deps log test, fix the other oneEvan Martin2013-04-091-10/+81
| | | | | | The first test I wrote was wrong; write a simpler test that exercises the "no failures" code paths, then fix the second test and the bugs it exposed.
* Make deps=gcc without depfile an error.Nico Weber2013-04-091-0/+18
| | | | | | | | | | | | When I first played with depslog, I accidentally removed the depfile attribute on my cc edges, which had the effect of ninja silently ignoring all depfiles. Instead, let ninja complain about edges that have deps set to gcc and depfile set to nothing. This is done at edge build time, instead of at mainfest load time, because adding this check to ParseEdge() regressed empty build time for target 'chrome' by 30ms. The check is only useful for generator authors, regular users should never see this.
* add a test for the "deps out of date" caseEvan Martin2013-04-091-0/+96
| | | | It touched the various remaining XXXes in the code, hooray.
* add a test verifying build failure on bad depsEvan Martin2013-04-081-0/+17
|
* remove depfiles files as they're parsedEvan Martin2013-04-081-0/+6
|
* plumb DepsLog load through BuilderEvan Martin2013-04-081-1/+1
|
* pass command results via a structEvan Martin2013-04-081-17/+18
| | | | | WaitForCommand now passes all command output via a struct. This will allow adding more output in a future change.
* split FakeCommandRunner out of BuildTestEvan Martin2013-04-081-87/+95
| | | | Separating concerns to make a subsequent refactoring easier.
* move test virtual time "now_" into VirtualFileSystemEvan Martin2013-04-081-79/+78
| | | | It's the only piece that cares about the current time.
* Add regression testRobert Iannucci2013-03-231-0/+74
|
* wrap some overlong linesEvan Martin2012-12-291-2/+4
|
* Fix formattingRobert Iannucci2012-11-301-6/+6
|
* Revert "Dump state for debugging"Robert Iannucci2012-11-101-4/+0
| | | | This reverts commit 9b196dc806e57cefd88bbbacd12286447dbf9ad9.
* Dump state for debuggingRobert Iannucci2012-11-101-0/+4
|
* cover the nulled pool caseRobert Iannucci2012-11-101-19/+20
|
* Add some tests!Robert Iannucci2012-11-101-3/+129
|
* Fix two spelling errorsMartin Olsson2012-10-031-1/+1
|
* move BuildLog to DependencyScanEvan Martin2012-09-041-2/+3
| | | | | | | The build log is needed in computing whether an edge is dirty, so I think it belongs here. (It's a bit weird that Builder needs to reach into it to record completed commands, maybe it will become cleaner with more thought.)
* if a file is missing in the log, count it as dirtyScott Graham2012-08-151-2/+54
| | | | | | | This could cause overbuilding (if the log is missing an entry and the right file is already in place) but is otherwise necessary for correctness (if a file is already in place but we don't have a log entry for it).
* use DiskInterface to create the build directoryEvan Martin2012-08-071-5/+3
| | | | | | | | | | Fixes issue #392 (didn't handle creating nested build dirs right). Moves MakeDir out of util.h; all code should go through DiskInterface to simplify testing. Moves ownership of the DiskInterface into the client of the Builder, which also allows removing some code that reached inside the object as well as a minor leak.
* Merge pull request #313 from wolfp/restat_missing_inputEvan Martin2012-07-031-0/+54
|\ | | | | Do not reset restat_mtime if an input is missing
| * Add a test for missing input files in restat ruleswolfp2012-06-271-0/+54
| |
* | Only store command hashes in the build log.Nico Weber2012-06-151-2/+4
|/ | | | | | | | | | | | | | .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.
* reduce custom ninja status patch in minor waysEvan Martin2012-04-261-31/+2
| | | | | Elsewhere in the code I avoid sstream and manual buffer management, so switch this code to behave similarly. Sorry for being OCD.