summaryrefslogtreecommitdiffstats
path: root/src/manifest_parser_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* fix multiple sequential slashesScott Graham2014-11-081-2/+2
|
* wip on adding tests at higher level, some not rightScott Graham2014-11-081-0/+48
|
* CanonicalizePath handles \ on WindowsScott Graham2014-10-301-13/+9
|
* Merge pull request #812 from nico/ninjatestNico Weber2014-09-181-3/+2
|\ | | | | Use a small, standalone testing framework for ninja instead of googletest.
| * Use a small, standalone testing framework instead of googletest.Nico Weber2014-09-181-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Provide an error message on malformed lets. Fixes #807.Nico Weber2014-09-041-0/+9
|/
* More robust escaping of $in, $out pathsNicholas Hutchinson2014-01-061-0/+4
| | | | | | 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.
* Add a test that shows that there is a single global namespace for rules.Nico Weber2013-10-271-0/+15
|
* Merge pull request #623 from nico/fixNico Weber2013-07-191-0/+11
|\ | | | | Fix diagnostic formatting regression caused by adaa91a33eb2cf23b88.
| * Fix diagnostic formatting regression caused by adaa91a33eb2cf23b88.Nico Weber2013-07-191-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Add test for a manifest ending in the middle of a keyword.Nico Weber2013-07-181-0/+11
|/
* Improve error message for duplicate rules and unknown pools.Nico Weber2013-07-021-0/+102
| | | | | Also add more tests for invalid manifests. According to gcov, these invalid inputs weren't tested before.
* Remove a few unused includes.Nico Weber2013-05-121-0/+3
|
* drop std:: qualifiers on more stl datatypesEvan Martin2013-04-181-1/+1
| | | | We "using namespace std" anywhere we need a std::string or a std::vector.
* make it an error for now to have multiple outputs with depslogEvan Martin2013-04-081-0/+12
|
* ManifestParser constructor accesses its first argument, don't pass NULLNico Weber2013-01-031-3/+6
| | | | | | | | | | | 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.
* rearrange handling of builtin bindings to make rules simplerEvan Martin2012-12-291-8/+12
| | | | | Now, a 'build' block can override any special binding like 'command' or 'description' if it needs to.
* update old test to cover newer rule attributesEvan Martin2012-08-241-1/+4
|
* add test that checks attributes on rulesEvan Martin2012-08-241-0/+11
|
* reject tabs (and CRs) in input files more aggressivelyEvan Martin2012-08-021-1/+1
|
* disallow crlf in manifest filesEvan Martin2012-07-181-0/+20
| | | | | | | | | | | | | | | 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.
* Rename parsers.* to manifest_parser.*Thiago Farina2012-07-091-0/+684
So it matches with the class name in there. Signed-off-by: Thiago Farina <tfarina@chromium.org>