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/dotest.py | |
parent | 998373c0595288d813648200f984b03f82645413 (diff) | |
download | bcm5719-llvm-33ed57eebd408a5345b61c4075b730e990b70e62.tar.gz bcm5719-llvm-33ed57eebd408a5345b61c4075b730e990b70e62.zip |
[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/dotest.py')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/dotest.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/dotest.py b/lldb/packages/Python/lldbsuite/test/dotest.py index 83616d1214b..f0c5844e53e 100644 --- a/lldb/packages/Python/lldbsuite/test/dotest.py +++ b/lldb/packages/Python/lldbsuite/test/dotest.py @@ -439,7 +439,7 @@ def parseOptionsAndInitTestdirs(): configuration.num_threads = args.num_threads if args.test_subdir: - configuration.multiprocess_test_subdir = args.test_subdir + configuration.exclusive_test_subdir = args.test_subdir if args.test_runner_name: configuration.test_runner_name = args.test_runner_name @@ -895,6 +895,7 @@ def visit_file(dir, name): unittest2.defaultTestLoader.loadTestsFromName(base)) +# TODO: This should be replaced with a call to find_test_files_in_dir_tree. def visit(prefix, dir, names): """Visitor function for os.path.walk(path, visit, arg).""" @@ -1172,7 +1173,6 @@ def run_suite(): from . import dosep dosep.main( configuration.num_threads, - configuration.multiprocess_test_subdir, configuration.test_runner_name, configuration.results_formatter_object) raise Exception("should never get here") @@ -1267,10 +1267,15 @@ def run_suite(): # Don't do lldb-server (llgs) tests on anything except Linux. configuration.dont_do_llgs_test = not ("linux" in target_platform) - # - # Walk through the testdirs while collecting tests. - # - for testdir in configuration.testdirs: + # Collect tests from the specified testing directories. If a test + # subdirectory filter is explicitly specified, limit the search to that + # subdirectory. + exclusive_test_subdir = configuration.get_absolute_path_to_exclusive_test_subdir() + if exclusive_test_subdir: + dirs_to_search = [exclusive_test_subdir] + else: + dirs_to_search = configuration.testdirs + for testdir in dirs_to_search: for (dirpath, dirnames, filenames) in os.walk(testdir): visit('Test', dirpath, filenames) |