summaryrefslogtreecommitdiffstats
path: root/src/ninja_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* Add 'using namespace std;' to all cc files to prepare for removing it from ↵Michael Jones2020-09-301-0/+2
| | | | header files
* Add <stdlib.h> includes for clang++/libc++ on UbuntuDan Willemsen2016-04-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | There are a number of stdlib.h uses in these files without including stdlib.h: hash_collision_bench.cc: rand, RAND_MAX, srand manifest_parser_perftest.cc: system, exit ninja_test.cc: EXIT_SUCCESS, EXIT_FAILURE test.cc: getenv, mkdtemp, system This works on a Ubuntu g++/libstdc++ build, as the <algorithm> header pulls in stdlib.h, and on a OSX clang++/libc++ build the <map> and <string> headers pull in stdlib.h. But a Ubuntu clang++/libc++ build does not pull in stdlib.h with any of these other headers. $ apt-get install clang-3.6 libc++-dev $ CXX=clang++-3.6 CFLAGS=-stdlib=libc++ LDFLAGS=-stdlib=libc++ \ ./configure.py $ ninja ninja_test hash_collision_bench manifest_parser_perftest This was originally discovered using the host toolchain provided with Android, but the Ubuntu version is much easier to reproduce.
* Fix getopt for AIXMike Seplowitz2015-08-191-0/+3
| | | | | | | AIX supplies getopt but not getopt_long. We can't use the embedded getopt implementation, since the constness of its arguments doesn't match the AIX system routine.
* Don't support ? and : for --gtest-filter, a bit simpler.Nico Weber2014-09-181-23/+11
| | | | Let me know if you use these!
* Add support for --gtest_filter. The bots need it, and it is a useful flag.Nico Weber2014-09-181-8/+97
|
* Use a small, standalone testing framework instead of googletest.Nico Weber2014-09-181-49/+40
| | | | | | | | | | | | | | | | | | | | | 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.
* structs not classes.Thiago Farina2013-05-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | For some reason that I do not, ninja prefers: struct Foo { Foo(); private: void Blah(); }; Rather than class Foo { public: Foo(); private: void Blah(); }; This catches the last two usages of "class" in the code base. Signed-off-by: Thiago Farina <tfarina@chromium.org>
* 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.
* also print iteration for gtest_repeat=-1Scott Graham2013-04-181-4/+12
|
* reset count in LaconicPrinter for when using --gtest_repeatScott Graham2013-04-171-0/+5
|
* fix testScott Graham2013-04-091-1/+1
|
* Try to fix build on Linux more.Nico Weber2013-04-091-1/+3
|
* Make ninja_test output nicer.Nico Weber2013-04-091-8/+12
|
* Use LinePrinter in test runner.Nico Weber2013-04-091-21/+23
|
* move single-line printing to new classNico Weber2013-04-091-0/+14
|
* Make gtest output more silent, ninja issue #528.Nico Weber2013-04-091-0/+54
| | | | | This is just a proof-of-concept. The terminal printing logic should be extracted from src/build.cc and then reused here.
* Split ninja_test.cc into state_test.cc and disk_interface_test.ccThiago Farina2011-09-111-141/+0
| | | | Signed-off-by: Thiago Farina <tfarina@chromium.org>
* Move EvalString tests to eval_env_test.ccThiago Farina2011-09-091-73/+0
| | | | Signed-off-by: Thiago Farina <tfarina@chromium.org>
* Fix windows build by moving mkdtemp() implementation from ninja_test.cc to ↵Thiago Farina2011-09-081-28/+0
| | | | | | disk_interface_test.cc Signed-off-by: Thiago Farina <tfarina@chromium.org>
* Move DiskInterfaceTest into its own source file.Thiago Farina2011-09-071-102/+0
| | | | | | TEST=ninja_test --gtest_filter=DiskInterface* Signed-off-by: Thiago Farina <tfarina@chromium.org>
* Factor out State struct from ninja_jumble.cc into its header/source files.Thiago Farina2011-09-031-2/+0
| | | | | | This was a TODO in src/ninja_jumble.cc. Now this task is completed. Signed-off-by: Thiago Farina <tfarina@chromium.org>
* remove +x bit from sourceEvan Martin2011-06-031-0/+0
|
* Tests now build on a native Windows build (tested with VS2010)Philip Craig2011-05-281-1/+1
| | | | | All tests except SubProcess pass on a native Windows build Tests continue not to build on a platform=mingw build
* expand $$ as $Evan Martin2011-05-271-0/+9
|
* windows: pass the DiskInterface testsEvan Martin2011-05-081-21/+58
|
* windows: successfully link testsEvan Martin2011-05-061-19/+51
| | | | | It links, with some hacks. Tests still fail.
* fix unit testEvan Martin2011-05-021-1/+1
|
* Return non-zero status when errors occur.Nicolas Despres2011-05-021-4/+5
| | | | | | Clean all was not returning non-zero when an error occur (like when failing to remove a directory). This patch fix the problem and add a test for it.
* Add a test for the clean tool.Nicolas Despres2011-05-021-0/+13
| | | | It also fix a bug about the count of removed file reported.
* include location of error in parse error messages in EvalEnv stringsAlexei Svitkine2011-04-261-1/+11
| | | | | E.g. when parsing "foo = ${bar", point at the correct location of the missing curly brace.
* handle variable expansion with upper-case charactersOrestis Agathokleous2011-03-071-0/+11
|
* move test support into test.*Evan Martin2011-03-061-17/+1
|
* chdir into a temp dir before disk testsEvan Martin2011-03-051-0/+5
|
* add copyrightsEvan Martin2011-02-061-0/+14
|
* remove ResetDirtyEvan Martin2011-01-081-9/+0
|
* remove bottom-up dirtyingEvan Martin2011-01-081-5/+9
|
* split out graph into its own headerEvan Martin2011-01-081-3/+3
|
* move src into subdirEvan Martin2010-12-051-0/+235