aboutsummaryrefslogtreecommitdiff
path: root/paludis/util/process_TEST.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-19 19:03:51 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-21 14:58:16 +0100
commit322fc9a9acd2cfed2c3b7c70ee022e34fc1fd1f7 (patch)
treee9f6943b1c3f007e2c70cea75336a6278f0e5ef4 /paludis/util/process_TEST.cc
parent1bb84c09850dcf2136bc9134ead3409a3ccaf547 (diff)
downloadpaludis-322fc9a9acd2cfed2c3b7c70ee022e34fc1fd1f7.tar.gz
paludis-322fc9a9acd2cfed2c3b7c70ee022e34fc1fd1f7.tar.xz
Process::use_ptys
Diffstat (limited to 'paludis/util/process_TEST.cc')
-rw-r--r--paludis/util/process_TEST.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/paludis/util/process_TEST.cc b/paludis/util/process_TEST.cc
index a882151c3..1c344b04a 100644
--- a/paludis/util/process_TEST.cc
+++ b/paludis/util/process_TEST.cc
@@ -178,5 +178,35 @@ namespace test_cases
TEST_CHECK_EQUAL(stdout_stream.str(), "/\n");
}
} test_chdir;
+
+ struct NoPtyTest : TestCase
+ {
+ NoPtyTest() : TestCase("no pty") { }
+
+ void run()
+ {
+ std::stringstream stdout_stream, stderr_stream;
+ Process test_t_process(ProcessCommand({"test", "-t", "1", "-o", "-t", "2"}));
+ test_t_process.capture_stdout(stdout_stream);
+ test_t_process.capture_stderr(stderr_stream);
+ TEST_CHECK_EQUAL(test_t_process.run().wait(), 1);
+ }
+ } test_no_pty;
+
+ struct PtyTest : TestCase
+ {
+ PtyTest() : TestCase("pty") { }
+
+ void run()
+ {
+ std::stringstream stdout_stream, stderr_stream;
+ Process test_t_process(ProcessCommand({"test", "-t", "1", "-a", "-t", "2"}));
+ test_t_process.capture_stdout(stdout_stream);
+ test_t_process.capture_stderr(stderr_stream);
+ test_t_process.use_ptys();
+
+ TEST_CHECK_EQUAL(test_t_process.run().wait(), 0);
+ }
+ } test_ptys;
}