| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Now tests don't print anything. Non-test behavior is unchanged.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
Also add a test for this case, which would have spotted the issue too.
|
| |
|
|
|
|
|
|
| |
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().
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Introduce a Truncate() function that works on POSIX and Windows.
|
| |
| |
| |
| | |
Hopefully fixes the build on Windows.
|
|/
|
|
| |
Part of issue #554.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This doesn't yet exhibit the full problems with truncation, but it's
a start.
|
|
|
|
|
| |
I think I commented this out when tracking down a bug and forgot
to uncomment it.
|
| |
|
|
|
|
| |
Also add tests for invalid headers.
|
|
|
|
| |
Not done automatically yet, just an implementation and a test.
|
|
|
|
| |
Shortcuts a common case.
|
| |
|
|
DepsLog is a compact serialization of dependency information.
It can be used to replace depfiles for faster loading.
|