diff options
Diffstat (limited to 'src/subprocess_test.cc')
-rw-r--r-- | src/subprocess_test.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/subprocess_test.cc b/src/subprocess_test.cc index 9f8dcea..775a13a 100644 --- a/src/subprocess_test.cc +++ b/src/subprocess_test.cc @@ -95,6 +95,21 @@ TEST_F(SubprocessTest, InterruptParent) { ADD_FAILURE() << "We should have been interrupted"; } +TEST_F(SubprocessTest, Console) { + // Skip test if we don't have the console ourselves. + if (isatty(0) && isatty(1) && isatty(2)) { + Subprocess* subproc = subprocs_.Add("test -t 0 -a -t 1 -a -t 2", + /*use_console=*/true); + ASSERT_NE((Subprocess *) 0, subproc); + + while (!subproc->Done()) { + subprocs_.DoWork(); + } + + EXPECT_EQ(ExitSuccess, subproc->Finish()); + } +} + #endif TEST_F(SubprocessTest, SetWithSingle) { |