From 95536ab53bba952d748f6c1535ba9a3b2ff7e294 Mon Sep 17 00:00:00 2001 From: vladlosev Date: Wed, 26 Nov 2008 20:02:45 +0000 Subject: Fixed gtest_break_on_failure_unittest on Ubuntu 8.04 and Windows --- test/gtest_xml_output_unittest.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'test/gtest_xml_output_unittest.py') diff --git a/test/gtest_xml_output_unittest.py b/test/gtest_xml_output_unittest.py index c5f9f57f..5e0b220b 100755 --- a/test/gtest_xml_output_unittest.py +++ b/test/gtest_xml_output_unittest.py @@ -131,10 +131,11 @@ class GTestXMLOutputUnitTest(gtest_xml_test_utils.GTestXMLTestCase): if e.errno != errno.ENOENT: raise - status = gtest_test_utils.RunCommandSuppressOutput( - "%s %s=xml" % (gtest_prog_path, GTEST_OUTPUT_FLAG), - working_dir=temp_dir) - self.assertEquals(0, gtest_test_utils.GetExitStatus(status)) + p = gtest_test_utils.Subprocess( + [gtest_prog_path, "%s=xml" % GTEST_OUTPUT_FLAG], + working_dir=temp_dir) + self.assert_(p.exited) + self.assertEquals(0, p.exit_code) self.assert_(os.path.isfile(output_file)) @@ -150,18 +151,17 @@ class GTestXMLOutputUnitTest(gtest_xml_test_utils.GTestXMLTestCase): gtest_prog_path = os.path.join(gtest_test_utils.GetBuildDir(), gtest_prog_name) - command = ("%s %s=xml:%s" % (gtest_prog_path, GTEST_OUTPUT_FLAG, xml_path)) - status = gtest_test_utils.RunCommandSuppressOutput(command) - if os.WIFSIGNALED(status): - signal = os.WTERMSIG(status) + command = [gtest_prog_path, "%s=xml:%s" % (GTEST_OUTPUT_FLAG, xml_path)] + p = gtest_test_utils.Subprocess(command) + if p.terminated_by_signal: self.assert_(False, - "%s was killed by signal %d" % (gtest_prog_name, signal)) + "%s was killed by signal %d" % (gtest_prog_name, p.signal)) else: - exit_code = gtest_test_utils.GetExitStatus(status) - self.assertEquals(expected_exit_code, exit_code, + self.assert_(p.exited) + self.assertEquals(expected_exit_code, p.exit_code, "'%s' exited with code %s, which doesn't match " "the expected exit code %s." - % (command, exit_code, expected_exit_code)) + % (command, p.exit_code, expected_exit_code)) expected = minidom.parseString(expected_xml) actual = minidom.parse(xml_path) -- cgit v1.2.3