summaryrefslogtreecommitdiffstats
path: root/src/build_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Refactor and test progress status formatting.Nicolas Despres2012-04-241-1/+36
|
* Remove trailing white spaces.Nicolas Despres2012-04-241-7/+7
|
* fix warning: "comparison between signed and unsigned integer expressions"Hiroyuki Iwatsuki2012-03-161-8/+8
|
* Mark a phony target with no inputs as outputs-readyPeter Collingbourne2012-03-051-0/+26
| | | | | | | | Even if such a target is dirty (i.e. the file does not exist), it has nothing to do, which makes it safe to mark as outputs-ready. Without this change, ninja will print no output when rebuilding the target (or an order-only dependency thereof), instead of reporting it has "no work to do".
* Be more selective about deleting output files when interruptedPeter Collingbourne2012-03-011-2/+57
| | | | | | | Specifically, only delete if the file was modified or if the rule uses a depfile. Fixes issue #226.
* Merge pull request #217 from PetrWolf/masterEvan Martin2012-02-231-1/+129
|\ | | | | Response files
| * Response filesunknown2012-02-091-1/+129
| |
* | If a command fails, wait for all running commands to terminate before we doPeter Collingbourne2012-02-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, if a command fails, the fate of the other child processes running in parallel was inadequately controlled. On POSIX platforms, the processes were orphaned. Normally they would run to completion, but were liable to being killed by a SIGPIPE. On Windows, the child processes would terminate with the parent. The cleanup-on-interrupt patch caused the SubprocessSet and Builder destructors to clean up after themselves by killing any running child processes and deleting their output files, making the behaviour more predictable and consistent across platforms. If the build is interrupted by the user, this is correct behaviour. But in the case where the build is stopped by a failed command, this would be inconsistent with user expectations. In the latter case, we now let any remaining child processes run to completion before leaving the main loop in Builder::Build.
* | Implement cleanup-on-interruptPeter Collingbourne2012-02-041-5/+10
|/ | | | | | | | This causes us to clean up by deleting any output files belonging to currently-running commands before we quit if we are interrupted (either by Ctrl-C or by a command failing). Fixes issue #110.
* windows: use _WIN32 define everywhereEvan Martin2012-01-221-2/+2
| | | | Rather than mixing use of WIN32 and _WIN32.
* Add a test that dry run shows all commands that could be run (noneFrances Buontempo2012-01-161-0/+36
| | | | cleaned) and a fix for this
* adjust restat behavior around missing outputsEvan Martin2012-01-051-0/+27
| | | | | | | If a restat rule claims to write an output but doesn't, consider it "no change" (in the restat sense) if the output didn't exist beforehand. I.e. if the output didn't exist before and the output doesn't exist after, we don't need to run dependent rules.
* adjust depfile test now that parsing is more laxEvan Martin2011-12-191-2/+3
|
* remove makefile parsing code, use depfile code insteadEvan Martin2011-12-071-1/+1
|
* make Rule::name_ privateEvan Martin2011-12-071-5/+5
|
* make Node::in_edge_ privateEvan Martin2011-12-071-1/+1
|
* make Node::dirty_ privateEvan Martin2011-12-071-20/+20
|
* merge FileStat into NodeEvan Martin2011-12-071-10/+10
| | | | | | The two were always one-to-one anyway. I started adding accessors to FileStat and then realized most users wanted them on Node and that forwarding them through was silly.
* add and use getter for Edge::rule_Evan Martin2011-12-071-5/+5
|
* disable the 'unused parameter' warningEvan Martin2011-12-051-1/+1
| | | | It was firing too often, and hadn't uncovered any bugs.
* when an edge is dirty, mark all outputs dirtyEvan Martin2011-12-041-3/+2
| | | | | | | | | | | | | | | The logic before was like: for each output: if edge_dirty or output.dirty: output.dirty = true edge_dirty = true This was wrong in the case where the second output would case the edge to be dirty; we needed to go back and mark the first output dirty as well. Fixed by taking two passes: one to compute the dirty state, then a latter sweep to mark all outputs. Fixes issue 148.
* add a test case from issue 148Evan Martin2011-12-041-0/+20
|
* Fix compilation warning in Ninja's test suite.Nicolas Despres2011-11-211-1/+1
|
* Implement restat rulesPeter Collingbourne2011-10-241-1/+61
| | | | | | | | | | | | | | | | | 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).
* Implement Make-style order-only dependenciesPeter Collingbourne2011-10-241-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the implementation of order-only dependencies differed between Make and Ninja in two important ways: 1) If the order-only dependency existed but was out of date, it would never be rebuilt, whereas Make would always rebuild out of date order-only dependencies. 2) If the order-only dependency did not exist, it would cause its reverse dependencies to always build, whereas Make would only rebuild a file if a non-order-only dependency was out of date. A key distinction between Ninja and Make as seen through the above two points was that in Ninja, order-only dependencies cared about whether the target as a file exists (so perhaps a better name for the old semantics would have been "missing-only dependencies"). These differences made it impossible to introduce an order-only dependency on an always out-of-date (i.e. missing) target without also causing the depender and its reverse dependencies to rebuild unnecessarily on every build. Build systems which must perform some action (such as logging the build start time, or printing a message) at the start of every build typically implement this by adding to every target an order-only dependency which performs this action, which would have forced an entire rebuild on every invocation of Ninja under the old semantics. This commit causes Ninja to conform to the Make-style behaviour.
* Split Node::dirty_ into two flags: Node::dirty_ and Edge::outputs_ready_Peter Collingbourne2011-10-181-21/+9
| | | | | dirty_ is intended to remain static during the build (unless a restat occurs), while outputs_ready_ reflects the dynamic state of the build.
* Consider missing phony targets with no dependencies out of datePeter Collingbourne2011-09-141-0/+9
| | | | | | | | | | | | | | | Commit 639c8f0 ("don't mark phony edges dirty if none of their inputs are dirty") modified the behaviour of the "phony" built-in rule. Previously, when the output file was missing, it was marked as dirty. After 639c8f0, it was always marked as clean unless one of the dependencies was dirty. The depfile mechanism uses the old behaviour of "phony" to rebuild an object file if any of the headers were missing. Restore the old "phony" behaviour only for the case where the build statement has no dependencies. This is slightly inconsistent, but I can't really see any other use case for an alias of nothing. Also, document this behaviour.
* Modify the build tests to use the virtual file systemPeter Collingbourne2011-09-141-6/+15
|
* don't mark phony edges dirty if none of their inputs are dirtyEvan Martin2011-09-091-6/+12
| | | | | | | Because the output file is always missing, we'd consider a phony edge dirty even when there wasn't any work to do. Most importantly, that would mean we wouldn't print "nothing to do" in the common case of everything being up to date when building an alias.
* fix redundant manifest rebuildEvan Martin2011-09-081-11/+13
| | | | | | | Don't rebuild the manifest when it's already up to date. The underlying problem was that Builder::Build has a confusing API; split the API so it's more clear for callers what the return values mean.
* Add a test for the multiple outputs fixQingning Huo2011-06-141-1/+19
|
* remove +x bit from sourceEvan Martin2011-06-031-0/+0
|
* On Windows, ninja didn't create needed paths firstPhilip Craig2011-06-021-2/+11
| | | | | | | | | | | | | Now it does. Still works as it should on linux too. The canonical example that now works on Windows is: builddir = build rule copy command = copy $in $out build $builddir\fred\test.out: copy test.in
* use 0 for NULL in test to silence gcc 4.5 warningEvan Martin2011-05-271-1/+1
|
* add extra check for no error in build testEvan Martin2011-05-171-0/+1
|
* simplify CommandRunner, simplifying users tooEvan Martin2011-05-171-7/+2
| | | | | After much staring at this I think I found the more clear way to express what it's doing.