[llvm] [Offload] fix OffloadAPI unittests discovery (PR #198750)
via llvm-commits
llvm-commits at lists.llvm.org
Wed May 20 04:21:22 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-offload
Author: Piotr Balcer (pbalcer)
<details>
<summary>Changes</summary>
Commit 3383f0d repointed LIBOMPTARGET_LIBRARY_DIR to a different runtimes lib dir, but the unit lit config still derived the unittest binary path from it. Pass the unittest directory explicitly instead.
---
Full diff: https://github.com/llvm/llvm-project/pull/198750.diff
3 Files Affected:
- (modified) offload/test/CMakeLists.txt (+1)
- (modified) offload/test/unit/lit.cfg.py (+1-1)
- (modified) offload/test/unit/lit.site.cfg.in (+1)
``````````diff
diff --git a/offload/test/CMakeLists.txt b/offload/test/CMakeLists.txt
index e8c12a7be6417..13e8c8d93d3d3 100644
--- a/offload/test/CMakeLists.txt
+++ b/offload/test/CMakeLists.txt
@@ -52,6 +52,7 @@ add_offload_testsuite(check-libomptarget
ARGS ${LIBOMPTARGET_LIT_ARG_LIST})
# Add liboffload unit tests - the test binary will run on all available devices
+set(OFFLOAD_UNITTEST_DIR ${CMAKE_CURRENT_BINARY_DIR}/../unittests)
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/unit/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/unit/lit.site.cfg
diff --git a/offload/test/unit/lit.cfg.py b/offload/test/unit/lit.cfg.py
index 5c68f6be0009a..d4446e1e51998 100644
--- a/offload/test/unit/lit.cfg.py
+++ b/offload/test/unit/lit.cfg.py
@@ -15,7 +15,7 @@
# test_source_root: The root path where tests are located.
# test_exec_root: The root path where tests should be run.
-config.test_exec_root = os.path.join(config.library_dir, "unittests")
+config.test_exec_root = config.unittest_dir
config.test_source_root = config.test_exec_root
# testFormat: The test format to use to interpret tests.
diff --git a/offload/test/unit/lit.site.cfg.in b/offload/test/unit/lit.site.cfg.in
index 8019878fae424..f91480dff2a4d 100644
--- a/offload/test/unit/lit.site.cfg.in
+++ b/offload/test/unit/lit.site.cfg.in
@@ -1,6 +1,7 @@
@AUTO_GEN_COMMENT@
config.library_dir = "@LIBOMPTARGET_LIBRARY_DIR@"
+config.unittest_dir = "@OFFLOAD_UNITTEST_DIR@"
config.llvm_build_mode = lit_config.substitute("@LLVM_BUILD_MODE@")
# Let the main config do the real work.
``````````
</details>
https://github.com/llvm/llvm-project/pull/198750
More information about the llvm-commits
mailing list