summaryrefslogtreecommitdiffstats
path: root/src/subprocess_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* Only run SubprocessTest.SetWithLots on FreeBSD when ppoll() exists.Nico Weber2016-11-071-3/+1
| | | | Should fix #1189 after #1185.
* Use posix_spawn() instead of fork()/exec().Nico Weber2016-03-211-1/+2
| | | | | posix_spawn() is a syscall on OS X and Solaris and a bit faster. It's also easier emulate for cygwin, and the code is a bit simpler.
* Revert #910.Nico Weber2016-03-051-26/+1
| | | | | | | | | | | The change caused some issues (it makes it impossible ot use posix_spawn() and makes it harder to suspend children on ctrl-z). After discussing with jln: Since it fixes a corner case that can be fixed by explicitly running commands that need it in a wrapper that setsid()s them, let's try reverting it for a while. Please shout if this is a problem for you. See also #1097.
* Remove unnecessary `std::`Tetsuo Kiso2016-01-101-2/+2
|
* Cleanup build on SIGHUP.Nicolas Despres2015-09-201-0/+24
| | | | | SIGHUP is sent when the connection hang up (i.e. when the terminal window is closed or the ssh connection is closed).
* Allow SIGTERM for interruption.Nicolas Despres2015-04-241-1/+25
| | | | | Default signal sent by many other programs (mainly kill(1)) to gently terminates another one is SIGTERM.
* Merge pull request #917 from pinotree/rlimitNico Weber2015-03-091-2/+2
|\ | | | | subprocess_test: gracefully handle rlim.rlim_cur < kNumProcs
| * subprocess_test: gracefully handle rlim.rlim_cur < kNumProcsPino Toscano2015-02-281-2/+2
| | | | | | | | | | | | Instead of expecting that the number of open files is well above kNumProcs, simply "skip" the test in that case, still printing the message about the test limit (adding the current system limit too).
* | POSIX: detach background subprocesses from terminal.Julien Tinnes2015-01-291-3/+28
|/ | | | | | | | Put background subprocesses (i.e. subprocesses with no access to the console) in their own session and detach them from the terminal. This fixes martine/ninja#909.
* fix warningNico Weber2014-09-181-1/+1
|
* Use a small, standalone testing framework instead of googletest.Nico Weber2014-09-181-4/+6
| | | | | | | | | | | | | | | | | | | | | 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.
* Introduce the "console" poolPeter Collingbourne2014-02-031-0/+15
| | | | | | | This is a pre-defined pool with a depth of 1. It has the special property that any task in the pool has direct access to the console. This can be useful for interactive tasks or long-running tasks which produce status updates on the console (such as test suites).
* Exclude Windows as wellDavid Hill2013-07-011-2/+2
|
* ugh, missing #David Hill2013-06-291-1/+1
|
* cleanup based on comments from martineDavid Hill2013-06-291-1/+1
|
* support BitrigDavid Hill2013-06-291-2/+2
|
* Add support for OpenBSD.Matthew Dempsky2013-05-011-2/+2
| | | | | | Use ppoll() on OpenBSD. Also, fix interrupt handling to recognize that on FreeBSD and OpenBSD, an interrupt might have been delivered even if pselect()/ppoll() don't return -1/EINTR.
* wrap some overlong linesEvan Martin2012-12-291-1/+2
|
* correctly open /dev/null in subprocessesEvan Martin2012-12-211-0/+15
| | | | Fixes issue #468.
* Disable SubprocessTest.TestWithLots on OS X.Nico Weber2012-07-281-2/+4
| | | | It fails on OS X, see issue #384.
* subprocess_test: make SetWithLots run on all non-Windows platformsEvan Martin2012-07-171-4/+6
| | | | | I think it might have been an oversight that this was marked Linux-specific.
* Add missing include of <sys/resouce.h>Oleksandr Usov2012-07-161-0/+5
|
* addressed pcc commentsAmi Fischman2012-03-041-2/+10
|
* pselect->ppoll on linux to raise the process limit roofAmi Fischman2012-03-041-1/+21
|
* Implement cleanup-on-interruptPeter Collingbourne2012-02-041-16/+40
| | | | | | | | 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.
* Add a test, NoSuchCommand.Qingning Huo2012-01-251-0/+18
|
* Fix for win32 long command lines:U-MATHLETE\John2011-06-261-4/+4
| | | | | | - remove 'cmd /c' prepend from SubProcess::Start() - fix the subprocess tests to prepend 'cmd /c' explicitly
* mingw ninja_test links and passes. (as do linux and native VS2010)Philip Craig2011-05-291-20/+7
| | | | | | Use chsize instead of truncate for mingw compatibility SubprocessTest uses DoWork to force Subprocesses to execute Drop GoodCommandStdOut test as it is tested in SetWithSingle
* windows: pass subprocess testsEvan Martin2011-05-081-28/+51
|
* windows: successfully link testsEvan Martin2011-05-061-5/+5
| | | | | It links, with some hacks. Tests still fail.
* fix tests broken by previous commitEvan Martin2011-05-061-6/+6
|
* refactor subprocess to make it easier for windows portEvan Martin2011-05-031-15/+11
| | | | | | Rather than tracking stdout/stderr explicitly, just keep an opaque pointer to a platform-specific 'stream' type. Also provide API to get at the process output.
* add copyrightsEvan Martin2011-02-061-0/+14
|
* move src into subdirEvan Martin2010-12-051-0/+82