rupprecht created this revision.
rupprecht added reviewers: JDevlieghere, labath.
Herald added subscribers: llvm-commits, lldb-commits, mgorny.
Herald added projects: LLDB, LLVM.
The lldb tree contains a symlink directory, `lldb/test/API/testcases`, which
points to the tests in `../../packages/Python/lldbsuite/test`. Because the
`add_lit_testsuites()` cmake rule does not follow symlinks, it doesn't find the
nested directory tree to create make/ninja rules for.
Also, because the lldb lit config points the source root directly into the
testcases tree, the `check-lldb-api-testcases` rule fails to find the
`testcases` directory, and therefore finds no tests. Changing the source root
to the containing lit file, like most lit configs do, fixes this.
After this patch, `ninja check-lldb-api-testcases-linux` works, and runs only
the test cases in `lldb/packages/Python/lldbsuite/test/linux`.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D70622
Files:
lldb/test/API/lit.cfg.py
llvm/cmake/modules/AddLLVM.cmake
Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -1488,7 +1488,8 @@
# Search recursively for test directories by assuming anything not
# in a directory called Inputs contains tests.
- file(GLOB_RECURSE to_process LIST_DIRECTORIES true ${directory}/*)
+ # Follow symlinks as some tests in lldb are structured that way.
+ file(GLOB_RECURSE to_process FOLLOW_SYMLINKS LIST_DIRECTORIES true
${directory}/*)
foreach(lit_suite ${to_process})
if(NOT IS_DIRECTORY ${lit_suite})
continue()
Index: lldb/test/API/lit.cfg.py
===================================================================
--- lldb/test/API/lit.cfg.py
+++ lldb/test/API/lit.cfg.py
@@ -17,8 +17,7 @@
# test_source_root: The root path where tests are located.
# test_exec_root: The root path where tests should be run.
-config.test_source_root = os.path.join(config.lldb_src_root, 'packages',
- 'Python', 'lldbsuite', 'test')
+config.test_source_root = os.path.dirname(__file__)
config.test_exec_root = config.test_source_root
if 'Address' in config.llvm_use_sanitizer:
Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -1488,7 +1488,8 @@
# Search recursively for test directories by assuming anything not
# in a directory called Inputs contains tests.
- file(GLOB_RECURSE to_process LIST_DIRECTORIES true ${directory}/*)
+ # Follow symlinks as some tests in lldb are structured that way.
+ file(GLOB_RECURSE to_process FOLLOW_SYMLINKS LIST_DIRECTORIES true ${directory}/*)
foreach(lit_suite ${to_process})
if(NOT IS_DIRECTORY ${lit_suite})
continue()
Index: lldb/test/API/lit.cfg.py
===================================================================
--- lldb/test/API/lit.cfg.py
+++ lldb/test/API/lit.cfg.py
@@ -17,8 +17,7 @@
# test_source_root: The root path where tests are located.
# test_exec_root: The root path where tests should be run.
-config.test_source_root = os.path.join(config.lldb_src_root, 'packages',
- 'Python', 'lldbsuite', 'test')
+config.test_source_root = os.path.dirname(__file__)
config.test_exec_root = config.test_source_root
if 'Address' in config.llvm_use_sanitizer:
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits