diff options
author | Vedant Kumar <vsk@apple.com> | 2018-08-16 19:56:38 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2018-08-16 19:56:38 +0000 |
commit | 33ed57eebd408a5345b61c4075b730e990b70e62 (patch) | |
tree | 2c8db57be7eb82cfb0eaff53aaebca8f03e7b6eb /lldb/packages/Python/lldbsuite/test/configuration.py | |
parent | 998373c0595288d813648200f984b03f82645413 (diff) | |
download | llvm-33ed57eebd408a5345b61c4075b730e990b70e62.zip llvm-33ed57eebd408a5345b61c4075b730e990b70e62.tar.gz llvm-33ed57eebd408a5345b61c4075b730e990b70e62.tar.bz2 |
[dotest] Make --test-subdir work with --no-multiprocess
The single-process test runner is invoked in a number of different
scenarios, including when multiple test dirs are specified or (afaict)
when lit is used to drive the test suite.
Unfortunately the --test-subdir option did not work with the single
process test runner, breaking an important use case (using lit to run
swift-lldb Linux tests):
Failure URL: https://ci.swift.org/job/swift-PR-Linux/6841
We won't be able to run lldb tests within swift PR testing without
filtering down the set of tests.
This change makes --test-subdir work with the single-process runner.
llvm-svn: 339929
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/configuration.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/configuration.py | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/configuration.py b/lldb/packages/Python/lldbsuite/test/configuration.py index 9478105..a1a0ced 100644 --- a/lldb/packages/Python/lldbsuite/test/configuration.py +++ b/lldb/packages/Python/lldbsuite/test/configuration.py @@ -110,9 +110,13 @@ lldb_platform_working_dir = None # The base directory in which the tests are being built. test_build_dir = None +# The only directory to scan for tests. If multiple test directories are +# specified, and an exclusive test subdirectory is specified, the latter option +# takes precedence. +exclusive_test_subdir = None + # Parallel execution settings is_inferior_test_runner = False -multiprocess_test_subdir = None num_threads = None no_multiprocess_test_runner = False test_runner_name = None @@ -144,3 +148,34 @@ def shouldSkipBecauseOfCategories(test_categories): return True return False + + +def get_absolute_path_to_exclusive_test_subdir(): + """ + If an exclusive test subdirectory is specified, return its absolute path. + Otherwise return None. + """ + test_directory = os.path.dirname(os.path.realpath(__file__)) + + if not exclusive_test_subdir: + return + + if len(exclusive_test_subdir) > 0: + test_subdir = os.path.join(test_directory, exclusive_test_subdir) + if os.path.isdir(test_subdir): + return test_subdir + + print('specified test subdirectory {} is not a valid directory\n' + .format(test_subdir)) + + +def get_absolute_path_to_root_test_dir(): + """ + If an exclusive test subdirectory is specified, return its absolute path. + Otherwise, return the absolute path of the root test directory. + """ + test_subdir = get_absolute_path_to_exclusive_test_subdir() + if test_subdir: + return test_subdir + + return os.path.dirname(os.path.realpath(__file__)) |