diff options
author | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-11-17 22:41:27 (GMT) |
---|---|---|
committer | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-11-17 22:41:27 (GMT) |
commit | 24ccb2c3e079dc0387e9a48cf6414ba982af8a45 (patch) | |
tree | 25d8cfc451d1b7968433b2dc777eef32151547c4 /test | |
parent | b99c9eceabcf2fcd8a07880fe5d14cbfecbd6cc0 (diff) | |
download | googletest-24ccb2c3e079dc0387e9a48cf6414ba982af8a45.zip googletest-24ccb2c3e079dc0387e9a48cf6414ba982af8a45.tar.gz googletest-24ccb2c3e079dc0387e9a48cf6414ba982af8a45.tar.bz2 |
Blocks test binaries from inheriting GTEST_OUTPUT variable when invoked from Python test scripts (fixes issue 223).
Diffstat (limited to 'test')
-rwxr-xr-x | test/gtest_test_utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/gtest_test_utils.py b/test/gtest_test_utils.py index 385662a..591cdb8 100755 --- a/test/gtest_test_utils.py +++ b/test/gtest_test_utils.py @@ -51,6 +51,7 @@ except: _SUBPROCESS_MODULE_AVAILABLE = False # pylint: enable-msg=C6204 +GTEST_OUTPUT_VAR_NAME = 'GTEST_OUTPUT' IS_WINDOWS = os.name == 'nt' IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0] @@ -267,4 +268,11 @@ def Main(): # unittest.main(). Otherwise the latter will be confused by the # --gtest_* flags. _ParseAndStripGTestFlags(sys.argv) + # The tested binaries should not be writing XML output files unless the + # script explicitly instructs them to. + # TODO(vladl@google.com): Move this into Subprocess when we implement + # passing environment into it as a parameter. + if GTEST_OUTPUT_VAR_NAME in os.environ: + del os.environ[GTEST_OUTPUT_VAR_NAME] + _test_module.main() |