diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-06-17 21:06:27 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-06-17 21:06:27 +0000 |
commit | 532dc2de35f2cef191bc91c3587a9f8f4974756f (patch) | |
tree | 1dd721d45ddd731134dda23f8368781979dc0b09 /test/gtest_xml_outfiles_test.py | |
parent | 210ea10e7ad6e27342c7d9a46c2844a9bcbad396 (diff) | |
download | googletest-532dc2de35f2cef191bc91c3587a9f8f4974756f.tar.gz googletest-532dc2de35f2cef191bc91c3587a9f8f4974756f.tar.bz2 googletest-532dc2de35f2cef191bc91c3587a9f8f4974756f.zip |
Implements a subset of TR1 tuple needed by gtest and gmock (by Zhanyong Wan); cleaned up the Python tests (by Vlad Losev); made run_tests.py invokable from any directory (by Vlad Losev).
Diffstat (limited to 'test/gtest_xml_outfiles_test.py')
-rwxr-xr-x | test/gtest_xml_outfiles_test.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/test/gtest_xml_outfiles_test.py b/test/gtest_xml_outfiles_test.py index 9d627932..0fe947f0 100755 --- a/test/gtest_xml_outfiles_test.py +++ b/test/gtest_xml_outfiles_test.py @@ -33,17 +33,14 @@ __author__ = "keith.ray@gmail.com (Keith Ray)" -import gtest_test_utils import os -import sys -import tempfile -import unittest - from xml.dom import minidom, Node +import gtest_test_utils import gtest_xml_test_utils +GTEST_OUTPUT_SUBDIR = "xml_outfiles" GTEST_OUTPUT_1_TEST = "gtest_xml_outfile1_test_" GTEST_OUTPUT_2_TEST = "gtest_xml_outfile2_test_" @@ -71,7 +68,8 @@ class GTestXMLOutFilesTest(gtest_xml_test_utils.GTestXMLTestCase): # We want the trailing '/' that the last "" provides in os.path.join, for # telling Google Test to create an output directory instead of a single file # for xml output. - self.output_dir_ = os.path.join(tempfile.mkdtemp(), "") + self.output_dir_ = os.path.join(gtest_test_utils.GetTempDir(), + GTEST_OUTPUT_SUBDIR, "") self.DeleteFilesAndDir() def tearDown(self): @@ -87,7 +85,7 @@ class GTestXMLOutFilesTest(gtest_xml_test_utils.GTestXMLTestCase): except os.error: pass try: - os.removedirs(self.output_dir_) + os.rmdir(self.output_dir_) except os.error: pass @@ -100,7 +98,8 @@ class GTestXMLOutFilesTest(gtest_xml_test_utils.GTestXMLTestCase): def _TestOutFile(self, test_name, expected_xml): gtest_prog_path = gtest_test_utils.GetTestExecutablePath(test_name) command = [gtest_prog_path, "--gtest_output=xml:%s" % self.output_dir_] - p = gtest_test_utils.Subprocess(command, working_dir=tempfile.mkdtemp()) + p = gtest_test_utils.Subprocess(command, + working_dir=gtest_test_utils.GetTempDir()) self.assert_(p.exited) self.assertEquals(0, p.exit_code) |