From 957ed9fb5210a8e0e51f713387961d2538921aed Mon Sep 17 00:00:00 2001 From: vladlosev Date: Wed, 26 Nov 2008 20:06:52 +0000 Subject: [PATCH] Adding test/gtest_uninitialized_test.py missing from the previous check-in --- test/gtest_uninitialized_test.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/test/gtest_uninitialized_test.py b/test/gtest_uninitialized_test.py index 037daa8f..a3ba629c 100755 --- a/test/gtest_uninitialized_test.py +++ b/test/gtest_uninitialized_test.py @@ -67,24 +67,14 @@ def AssertEq(expected, actual): raise AssertionError -def GetOutput(command): - """Runs the given command and returns its output.""" - - stdin, stdout = os.popen2(command, 't') - stdin.close() - output = stdout.read() - stdout.close() - return output - - def TestExitCodeAndOutput(command): """Runs the given command and verifies its exit code and output.""" # Verifies that 'command' exits with code 1. - AssertEq(1, gtest_test_utils.GetExitStatus(os.system(command))) - - output = GetOutput(command) - Assert('InitGoogleTest' in output) + p = gtest_test_utils.Subprocess(command) + Assert(p.exited) + AssertEq(1, p.exit_code) + Assert('InitGoogleTest' in p.output) if IS_WINDOWS: