summaryrefslogtreecommitdiff
path: root/test/gtest_help_test.py
diff options
context:
space:
mode:
authorzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-08-19 22:16:00 +0000
committerzhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925>2010-08-19 22:16:00 +0000
commitc95489ee7dd54fc6a2cd1d3e890c330718ead714 (patch)
tree8cf27e0b642c7ad8eeb97858369d237fe104eb41 /test/gtest_help_test.py
parent9aaf3b8e95a91762c758d77b43199be0315a6578 (diff)
downloadgtest-c95489ee7dd54fc6a2cd1d3e890c330718ead714.tar.gz
gtest-c95489ee7dd54fc6a2cd1d3e890c330718ead714.tar.bz2
gtest-c95489ee7dd54fc6a2cd1d3e890c330718ead714.tar.xz
Removes the Windows golden file (by Vlad Losev); implements test result streaming (by Nikhil Jindal and cleaned up by Zhanyong Wan).
git-svn-id: http://googletest.googlecode.com/svn/trunk@478 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'test/gtest_help_test.py')
-rwxr-xr-xtest/gtest_help_test.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/gtest_help_test.py b/test/gtest_help_test.py
index dc67ed3..0777106 100755
--- a/test/gtest_help_test.py
+++ b/test/gtest_help_test.py
@@ -44,12 +44,13 @@ import re
import gtest_test_utils
+IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
IS_WINDOWS = os.name == 'nt'
PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_help_test_')
FLAG_PREFIX = '--gtest_'
-CATCH_EXCEPTIONS_FLAG = FLAG_PREFIX + 'catch_exceptions'
DEATH_TEST_STYLE_FLAG = FLAG_PREFIX + 'death_test_style'
+STREAM_RESULT_TO_FLAG = FLAG_PREFIX + 'stream_result_to'
UNKNOWN_FLAG = FLAG_PREFIX + 'unknown_flag_for_testing'
LIST_TESTS_FLAG = FLAG_PREFIX + 'list_tests'
INCORRECT_FLAG_VARIANTS = [re.sub('^--', '-', LIST_TESTS_FLAG),
@@ -72,7 +73,8 @@ HELP_REGEX = re.compile(
FLAG_PREFIX + r'print_time.*' +
FLAG_PREFIX + r'output=.*' +
FLAG_PREFIX + r'break_on_failure.*' +
- FLAG_PREFIX + r'throw_on_failure.*',
+ FLAG_PREFIX + r'throw_on_failure.*' +
+ FLAG_PREFIX + r'catch_exceptions.*',
re.DOTALL)
@@ -109,10 +111,11 @@ class GTestHelpTest(gtest_test_utils.TestCase):
exit_code, output = RunWithFlag(flag)
self.assertEquals(0, exit_code)
self.assert_(HELP_REGEX.search(output), output)
- if IS_WINDOWS:
- self.assert_(CATCH_EXCEPTIONS_FLAG in output, output)
+
+ if IS_LINUX:
+ self.assert_(STREAM_RESULT_TO_FLAG in output, output)
else:
- self.assert_(CATCH_EXCEPTIONS_FLAG not in output, output)
+ self.assert_(STREAM_RESULT_TO_FLAG not in output, output)
if SUPPORTS_DEATH_TESTS and not IS_WINDOWS:
self.assert_(DEATH_TEST_STYLE_FLAG in output, output)