diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2014-01-30 05:57:58 (GMT) |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2014-02-03 05:20:01 (GMT) |
commit | 2832613dc7c1a4a8ff3b9df729954715762a8381 (patch) | |
tree | 7f4be6edb18f26d73af002f977c2f4a901dfe2ea /src/subprocess_test.cc | |
parent | 84986af6fdeae3f649f2bf884b20f644bc370e48 (diff) | |
download | Ninja-2832613dc7c1a4a8ff3b9df729954715762a8381.zip Ninja-2832613dc7c1a4a8ff3b9df729954715762a8381.tar.gz Ninja-2832613dc7c1a4a8ff3b9df729954715762a8381.tar.bz2 |
Introduce the "console" pool
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).
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) { |