| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
Use a small, standalone testing framework for ninja instead of googletest.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/ |
|
|
|
|
|
|
| |
In summary: don’t escape if the path doesn’t contain problematic characters, otherwise:
- Shell: enclose string in single quotes, escape embedded single quotes with the magic quote-backslash-quote sequence
- Win32: Escape double quotes by doubling the number of consecutive backslashes that precede them (if any) and adding one more. Finally, double the number of trailing backslashes, and enclose the whole thing in double quotes.
|
| |
|
|\
| |
| | |
Fix diagnostic formatting regression caused by adaa91a33eb2cf23b88.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Ninja regressed to include a location for every file on the include stack for
nested diagnostics, i.e. it would print:
input:1: include.ninja:1: expected path
Fix this so that it prints only the current file location, like it used to:
include.ninja:1: expected path
Also add a test for this.
|
|/ |
|
|
|
|
|
| |
Also add more tests for invalid manifests. According to gcov, these invalid
inputs weren't tested before.
|
| |
|
|
|
|
| |
We "using namespace std" anywhere we need a std::string or a std::vector.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The constructor does
env_ = &state->bindings_;
so env_ is effectively set to offsetof(ManifestParser, bindings_). This
will blow up if env_ gets dereferenced -- this doesn't seem to happen in
these tests, but it's less confusing with this patch. Also, passing &state is
consistent with the rest of this test.
|
|
|
|
|
| |
Now, a 'build' block can override any special binding like 'command'
or 'description' if it needs to.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out to be trickier than expected to process these correctly.
It turns out to also be trickier than expected to give a nice error
message on encountering these. But the behavior prior to this patch
would just be silent failures where we attempted to examine paths
that accidentally contained embedded \r.
For now, fix all regexes of the form [^...] to include \r in the
excluded block, then assert that we get a vague lexer error near the
problem.
In the future perhaps we can open manifest files in text mode on Windows
or just disallow Windows-style CRLF in the manual.
|
|
So it matches with the class name in there.
Signed-off-by: Thiago Farina <tfarina@chromium.org>
|