summaryrefslogtreecommitdiffstats
path: root/src/subprocess_test.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2016-03-05 01:51:06 (GMT)
committerNico Weber <nicolasweber@gmx.de>2016-03-05 02:17:09 (GMT)
commite605fcc8ea91487e1653444ecf63f5597261f17c (patch)
tree67df569dd00fb5a050f484edb83d731b8495fe29 /src/subprocess_test.cc
parentd63fe50c493c397bae3b4a3dd08cfac128000a81 (diff)
downloadNinja-e605fcc8ea91487e1653444ecf63f5597261f17c.zip
Ninja-e605fcc8ea91487e1653444ecf63f5597261f17c.tar.gz
Ninja-e605fcc8ea91487e1653444ecf63f5597261f17c.tar.bz2
Revert #910.
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.
Diffstat (limited to 'src/subprocess_test.cc')
-rw-r--r--src/subprocess_test.cc27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/subprocess_test.cc b/src/subprocess_test.cc
index 2fe4bce..c8f2fb8 100644
--- a/src/subprocess_test.cc
+++ b/src/subprocess_test.cc
@@ -16,8 +16,6 @@
#include "test.h"
-#include <string>
-
#ifndef _WIN32
// SetWithLots need setrlimit.
#include <stdio.h>
@@ -146,22 +144,11 @@ TEST_F(SubprocessTest, InterruptParentWithSigHup) {
ASSERT_FALSE("We should have been interrupted");
}
-// A shell command to check if the current process is connected to a terminal.
-// This is different from having stdin/stdout/stderr be a terminal. (For
-// instance consider the command "yes < /dev/null > /dev/null 2>&1".
-// As "ps" will confirm, "yes" could still be connected to a terminal, despite
-// not having any of the standard file descriptors be a terminal.
-static const char kIsConnectedToTerminal[] = "tty < /dev/tty > /dev/null";
-
TEST_F(SubprocessTest, Console) {
// Skip test if we don't have the console ourselves.
if (isatty(0) && isatty(1) && isatty(2)) {
- // Test that stdin, stdout and stderr are a terminal.
- // Also check that the current process is connected to a terminal.
Subprocess* subproc =
- subprocs_.Add(string("test -t 0 -a -t 1 -a -t 2 && ") +
- string(kIsConnectedToTerminal),
- /*use_console=*/true);
+ subprocs_.Add("test -t 0 -a -t 1 -a -t 2", /*use_console=*/true);
ASSERT_NE((Subprocess*)0, subproc);
while (!subproc->Done()) {
@@ -172,18 +159,6 @@ TEST_F(SubprocessTest, Console) {
}
}
-TEST_F(SubprocessTest, NoConsole) {
- Subprocess* subproc =
- subprocs_.Add(kIsConnectedToTerminal, /*use_console=*/false);
- ASSERT_NE((Subprocess*)0, subproc);
-
- while (!subproc->Done()) {
- subprocs_.DoWork();
- }
-
- EXPECT_NE(ExitSuccess, subproc->Finish());
-}
-
#endif
TEST_F(SubprocessTest, SetWithSingle) {