~statik/ubuntu/maverick/protobuf/A

« back to all changes in this revision

Viewing changes to gtest/test/gtest_xml_outfiles_test.py

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2010-02-11 11:13:19 UTC
  • mfrom: (2.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100211111319-zdn8hmw0gh8s4cf8
Tags: 2.2.0a-0.1ubuntu1
* Merge from Debian testing.
* Remaining Ubuntu changes:
  - Don't use python2.4.
* Ubuntu changes dropped:
  - Disable death tests on Itanium, fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
__author__ = "keith.ray@gmail.com (Keith Ray)"
35
35
 
36
 
import gtest_test_utils
37
36
import os
38
 
import sys
39
 
import tempfile
40
 
import unittest
41
 
 
42
37
from xml.dom import minidom, Node
43
38
 
 
39
import gtest_test_utils
44
40
import gtest_xml_test_utils
45
41
 
46
42
 
 
43
GTEST_OUTPUT_SUBDIR = "xml_outfiles"
47
44
GTEST_OUTPUT_1_TEST = "gtest_xml_outfile1_test_"
48
45
GTEST_OUTPUT_2_TEST = "gtest_xml_outfile2_test_"
49
46
 
71
68
    # We want the trailing '/' that the last "" provides in os.path.join, for
72
69
    # telling Google Test to create an output directory instead of a single file
73
70
    # for xml output.
74
 
    self.output_dir_ = os.path.join(tempfile.mkdtemp(), "")
 
71
    self.output_dir_ = os.path.join(gtest_test_utils.GetTempDir(),
 
72
                                    GTEST_OUTPUT_SUBDIR, "")
75
73
    self.DeleteFilesAndDir()
76
74
 
77
75
  def tearDown(self):
87
85
    except os.error:
88
86
      pass
89
87
    try:
90
 
      os.removedirs(self.output_dir_)
 
88
      os.rmdir(self.output_dir_)
91
89
    except os.error:
92
90
      pass
93
91
 
100
98
  def _TestOutFile(self, test_name, expected_xml):
101
99
    gtest_prog_path = gtest_test_utils.GetTestExecutablePath(test_name)
102
100
    command = [gtest_prog_path, "--gtest_output=xml:%s" % self.output_dir_]
103
 
    p = gtest_test_utils.Subprocess(command, working_dir=tempfile.mkdtemp())
 
101
    p = gtest_test_utils.Subprocess(command,
 
102
                                    working_dir=gtest_test_utils.GetTempDir())
104
103
    self.assert_(p.exited)
105
104
    self.assertEquals(0, p.exit_code)
106
105