diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2013-09-06 22:50:25 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2013-09-06 22:50:25 +0000 |
commit | c306ef2e14483dbf4f047a3e1ca3f86111b800ca (patch) | |
tree | be89ba3a0f06a281e3c5e40cb230c5baf0a65a80 /test/gtest_break_on_failure_unittest.py | |
parent | 492986a5d05687853174862efc8e70fe31598eba (diff) | |
download | googletest-c306ef2e14483dbf4f047a3e1ca3f86111b800ca.tar.gz googletest-c306ef2e14483dbf4f047a3e1ca3f86111b800ca.tar.bz2 googletest-c306ef2e14483dbf4f047a3e1ca3f86111b800ca.zip |
supports a protocol for catching tests that prematurely exit
Diffstat (limited to 'test/gtest_break_on_failure_unittest.py')
-rwxr-xr-x | test/gtest_break_on_failure_unittest.py | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/test/gtest_break_on_failure_unittest.py b/test/gtest_break_on_failure_unittest.py index c8191833..78f3e0f5 100755 --- a/test/gtest_break_on_failure_unittest.py +++ b/test/gtest_break_on_failure_unittest.py @@ -66,21 +66,15 @@ EXE_PATH = gtest_test_utils.GetTestExecutablePath( 'gtest_break_on_failure_unittest_') -# Utilities. - - -environ = os.environ.copy() - - -def SetEnvVar(env_var, value): - """Sets an environment variable to a given value; unsets it when the - given value is None. - """ - - if value is not None: - environ[env_var] = value - elif env_var in environ: - del environ[env_var] +environ = gtest_test_utils.environ +SetEnvVar = gtest_test_utils.SetEnvVar + +# Tests in this file run a Google-Test-based test program and expect it +# to terminate prematurely. Therefore they are incompatible with +# the premature-exit-file protocol by design. Unset the +# premature-exit filepath to prevent Google Test from creating +# the file. +SetEnvVar(gtest_test_utils.PREMATURE_EXIT_FILE_ENV_VAR, None) def Run(command): |