diff options
author | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-12-16 23:34:59 +0000 |
---|---|---|
committer | zhanyong.wan <zhanyong.wan@861a406c-534a-0410-8894-cb66d6ee9925> | 2009-12-16 23:34:59 +0000 |
commit | 88e97c822c988eaa9f8bcbaa1ea5d702ffd7d384 (patch) | |
tree | 2ccb8a80d9d1ee12db0de85b03dc9e9ed957b25a /test/run_tests_util.py | |
parent | 075b76bb96f1b6eac7dde41b47de0dd456b0f473 (diff) | |
download | googletest-88e97c822c988eaa9f8bcbaa1ea5d702ffd7d384.tar.gz googletest-88e97c822c988eaa9f8bcbaa1ea5d702ffd7d384.tar.bz2 googletest-88e97c822c988eaa9f8bcbaa1ea5d702ffd7d384.zip |
Removes uses of GTEST_HAS_STD_STRING.
Diffstat (limited to 'test/run_tests_util.py')
-rwxr-xr-x | test/run_tests_util.py | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/test/run_tests_util.py b/test/run_tests_util.py index f1bb3e04..fb7fd387 100755 --- a/test/run_tests_util.py +++ b/test/run_tests_util.py @@ -152,6 +152,20 @@ def _GetGtestBuildDir(injected_os, script_dir, config): 'gtest/scons')) +def _GetConfigFromBuildDir(build_dir): + """Extracts the configuration name from the build directory.""" + + # We don't want to depend on build_dir containing the correct path + # separators. + m = re.match(r'.*[\\/]([^\\/]+)[\\/][^\\/]+[\\/]scons[\\/]?$', build_dir) + if m: + return m.group(1) + else: + print >>sys.stderr, ('%s is an invalid build directory that does not ' + 'correspond to any configuration.' % (build_dir,)) + return '' + + # All paths in this script are either absolute or relative to the current # working directory, unless otherwise specified. class TestRunner(object): @@ -270,7 +284,8 @@ class TestRunner(object): args, named_configurations, built_configurations, - available_configurations=CONFIGS): + available_configurations=CONFIGS, + python_tests_to_skip=None): """Determines what tests should be run. Args: @@ -278,7 +293,9 @@ class TestRunner(object): named_configurations: The list of configurations specified via -c or -a. built_configurations: True if -b has been specified. available_configurations: a list of configurations available on the - current platform, injectable for testing. + current platform, injectable for testing. + python_tests_to_skip: a collection of (configuration, python test name)s + that need to be skipped. Returns: A tuple with 2 elements: the list of Python tests to run and the list of @@ -356,7 +373,13 @@ class TestRunner(object): python_test_pairs = [] for directory in build_dirs: for test in selected_python_tests: - python_test_pairs.append((directory, test)) + config = _GetConfigFromBuildDir(directory) + file_name = os.path.basename(test) + if python_tests_to_skip and (config, file_name) in python_tests_to_skip: + print ('NOTE: %s is skipped for configuration %s, as it does not ' + 'work there.' % (file_name, config)) + else: + python_test_pairs.append((directory, test)) binary_test_pairs = [] for directory in build_dirs: |