"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "googletest/test/gtest_help_test.py" between
googletest-release-1.10.0.tar.gz and googletest-release-1.11.0.tar.gz

About: GoogleTest is Google's (unit) testing and mocking framework for C++ tests.

gtest_help_test.py  (googletest-release-1.10.0):gtest_help_test.py  (googletest-release-1.11.0)
skipping to change at line 45 skipping to change at line 45
gtest_help_test.py --build_dir=BUILD/DIR gtest_help_test.py --build_dir=BUILD/DIR
# where BUILD/DIR contains the built gtest_help_test_ file. # where BUILD/DIR contains the built gtest_help_test_ file.
gtest_help_test.py gtest_help_test.py
""" """
import os import os
import re import re
import gtest_test_utils import gtest_test_utils
IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux' IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
IS_GNUKFREEBSD = os.name == 'posix' and os.uname()[0] == 'GNU/kFreeBSD'
IS_WINDOWS = os.name == 'nt' IS_WINDOWS = os.name == 'nt'
PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_help_test_') PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_help_test_')
FLAG_PREFIX = '--gtest_' FLAG_PREFIX = '--gtest_'
DEATH_TEST_STYLE_FLAG = FLAG_PREFIX + 'death_test_style' DEATH_TEST_STYLE_FLAG = FLAG_PREFIX + 'death_test_style'
STREAM_RESULT_TO_FLAG = FLAG_PREFIX + 'stream_result_to' STREAM_RESULT_TO_FLAG = FLAG_PREFIX + 'stream_result_to'
UNKNOWN_FLAG = FLAG_PREFIX + 'unknown_flag_for_testing' UNKNOWN_FLAG = FLAG_PREFIX + 'unknown_flag_for_testing'
LIST_TESTS_FLAG = FLAG_PREFIX + 'list_tests' LIST_TESTS_FLAG = FLAG_PREFIX + 'list_tests'
INCORRECT_FLAG_VARIANTS = [re.sub('^--', '-', LIST_TESTS_FLAG), INCORRECT_FLAG_VARIANTS = [re.sub('^--', '-', LIST_TESTS_FLAG),
re.sub('^--', '/', LIST_TESTS_FLAG), re.sub('^--', '/', LIST_TESTS_FLAG),
skipping to change at line 70 skipping to change at line 71
# The help message must match this regex. # The help message must match this regex.
HELP_REGEX = re.compile( HELP_REGEX = re.compile(
FLAG_PREFIX + r'list_tests.*' + FLAG_PREFIX + r'list_tests.*' +
FLAG_PREFIX + r'filter=.*' + FLAG_PREFIX + r'filter=.*' +
FLAG_PREFIX + r'also_run_disabled_tests.*' + FLAG_PREFIX + r'also_run_disabled_tests.*' +
FLAG_PREFIX + r'repeat=.*' + FLAG_PREFIX + r'repeat=.*' +
FLAG_PREFIX + r'shuffle.*' + FLAG_PREFIX + r'shuffle.*' +
FLAG_PREFIX + r'random_seed=.*' + FLAG_PREFIX + r'random_seed=.*' +
FLAG_PREFIX + r'color=.*' + FLAG_PREFIX + r'color=.*' +
FLAG_PREFIX + r'brief.*' +
FLAG_PREFIX + r'print_time.*' + FLAG_PREFIX + r'print_time.*' +
FLAG_PREFIX + r'output=.*' + FLAG_PREFIX + r'output=.*' +
FLAG_PREFIX + r'break_on_failure.*' + FLAG_PREFIX + r'break_on_failure.*' +
FLAG_PREFIX + r'throw_on_failure.*' + FLAG_PREFIX + r'throw_on_failure.*' +
FLAG_PREFIX + r'catch_exceptions=0.*', FLAG_PREFIX + r'catch_exceptions=0.*',
re.DOTALL) re.DOTALL)
def RunWithFlag(flag): def RunWithFlag(flag):
"""Runs gtest_help_test_ with the given flag. """Runs gtest_help_test_ with the given flag.
skipping to change at line 110 skipping to change at line 112
skipped when the given flag is specified. skipped when the given flag is specified.
Args: Args:
flag: A flag to pass to the binary or None. flag: A flag to pass to the binary or None.
""" """
exit_code, output = RunWithFlag(flag) exit_code, output = RunWithFlag(flag)
self.assertEquals(0, exit_code) self.assertEquals(0, exit_code)
self.assert_(HELP_REGEX.search(output), output) self.assert_(HELP_REGEX.search(output), output)
if IS_LINUX: if IS_LINUX or IS_GNUKFREEBSD:
self.assert_(STREAM_RESULT_TO_FLAG in output, output) self.assert_(STREAM_RESULT_TO_FLAG in output, output)
else: else:
self.assert_(STREAM_RESULT_TO_FLAG not in output, output) self.assert_(STREAM_RESULT_TO_FLAG not in output, output)
if SUPPORTS_DEATH_TESTS and not IS_WINDOWS: if SUPPORTS_DEATH_TESTS and not IS_WINDOWS:
self.assert_(DEATH_TEST_STYLE_FLAG in output, output) self.assert_(DEATH_TEST_STYLE_FLAG in output, output)
else: else:
self.assert_(DEATH_TEST_STYLE_FLAG not in output, output) self.assert_(DEATH_TEST_STYLE_FLAG not in output, output)
def TestNonHelpFlag(self, flag): def TestNonHelpFlag(self, flag):
 End of changes. 3 change blocks. 
1 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)