diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-10-09 16:38:47 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-10-09 16:38:47 +0000 |
commit | 22314179f0660c172514b397060fd8f34b586e82 (patch) | |
tree | afb3f04cd285733772ffceec4ccf3d8539dca91c /lldb/test/Unit/lit.cfg.py | |
parent | df14bd315db94d286c0c75b4b6ee5d760f311399 (diff) | |
download | bcm5719-llvm-22314179f0660c172514b397060fd8f34b586e82.tar.gz bcm5719-llvm-22314179f0660c172514b397060fd8f34b586e82.zip |
[test] Split LLDB tests into API, Shell & Unit
LLDB has three major testing strategies: unit tests, tests that exercise
the SB API though dotest.py and what we currently call lit tests. The
later is rather confusing as we're now using lit as the driver for all
three types of tests. As most of this grew organically, the directory
structure in the LLDB repository doesn't really make this clear.
The 'lit' tests are part of the root and among these tests there's a
Unit and Suite folder for the unit and dotest-tests. This layout makes
it impossible to run just the lit tests.
This patch changes the directory layout to match the 3 testing
strategies, each with their own directory and their own configuration
file. This means there are now 3 directories under lit with 3
corresponding targets:
- API (check-lldb-api): Test exercising the SB API.
- Shell (check-lldb-shell): Test exercising command line utilities.
- Unit (check-lldb-unit): Unit tests.
Finally, there's still the `check-lldb` target that runs all three test
suites.
Finally, this also renames the lit folder to `test` to match the LLVM
repository layout.
Differential revision: https://reviews.llvm.org/D68606
llvm-svn: 374184
Diffstat (limited to 'lldb/test/Unit/lit.cfg.py')
-rw-r--r-- | lldb/test/Unit/lit.cfg.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lldb/test/Unit/lit.cfg.py b/lldb/test/Unit/lit.cfg.py new file mode 100644 index 00000000000..e53bcd394ca --- /dev/null +++ b/lldb/test/Unit/lit.cfg.py @@ -0,0 +1,30 @@ +# -*- Python -*- + +# Configuration file for the 'lit' test runner. + +import os +import sys + +import lit.formats +from lit.llvm import llvm_config + +# name: The name of this test suite. +config.name = 'lldb-unit' + +# suffixes: A list of file extensions to treat as test files. +config.suffixes = [] + +# test_source_root: The root path where unit test binaries are located. +# test_exec_root: The root path where tests should be run. +config.test_source_root = os.path.join(config.lldb_obj_root, 'unittests') +config.test_exec_root = config.test_source_root + +# One of our unit tests dynamically links against python.dll, and on Windows +# it needs to be able to find it at runtime. This is fine if Python is on your +# system PATH, but if it's not, then this unit test executable will fail to run. +# We can solve this by forcing the Python directory onto the system path here. +llvm_config.with_system_environment('PATH') +llvm_config.with_environment('PATH', os.path.dirname(sys.executable), append_path=True) + +# testFormat: The test format to use to interpret tests. +config.test_format = lit.formats.GoogleTest(config.llvm_build_mode, 'Tests') |