summaryrefslogtreecommitdiff
path: root/runtimes
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2022-03-16 19:46:28 +0100
committerSam McCall <sam.mccall@gmail.com>2022-05-06 12:30:49 +0200
commit7cc8377f2c572a919ecb2d22b2039acf3e6b745a (patch)
treeea9672c2dd46bc2ccb6b7f91cede383aec495242 /runtimes
parentf0e8c1d6d99ef686fd381c6af4debc7470876681 (diff)
downloadllvm-7cc8377f2c572a919ecb2d22b2039acf3e6b745a.tar.gz
Generalize "check-all" umbrella targets, use for check-clang-tools
The mechanism behind "check-all" is recording params of add_lit_testsuite() calls in global variables LLVM_LIT_*, and then creating an extra suite with their union at the end. This avoids composing the check-* targets directly, which doesn't work well. We generalize this by allowing multiple families of variables LLVM_{name}_LIT_*: umbrella_lit_testsuite_begin(check-foo) ... test suites here will be added to LLVM_FOO_LIT_* variables ... umbrella_lit_testsuite_end(check-foo) (This also moves some implementation muck out of {llvm,clang}/CMakeLists.txt This patch also changes check-clang-tools to use be an umbrella test target, which means the clangd and clang-pseudo tests are included in it, along with the the other testsuites that already are (like check-clang-extra-clang-tidy). Differential Revision: https://reviews.llvm.org/D121838
Diffstat (limited to 'runtimes')
-rw-r--r--runtimes/CMakeLists.txt27
-rw-r--r--runtimes/Tests.cmake.in6
2 files changed, 6 insertions, 27 deletions
diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt
index aa3cef531211..2246da7ea625 100644
--- a/runtimes/CMakeLists.txt
+++ b/runtimes/CMakeLists.txt
@@ -176,6 +176,8 @@ if(LLVM_INCLUDE_TESTS)
set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
endif()
set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
+
+ umbrella_lit_testsuite_begin(check-runtimes)
endif()
# llvm-libgcc incorporates both compiler-rt and libunwind as subprojects with very
@@ -200,36 +202,13 @@ endif()
foreach(entry ${runtimes})
get_filename_component(projName ${entry} NAME)
- # Between each sub-project we want to cache and clear the LIT properties
- set_property(GLOBAL PROPERTY LLVM_LIT_TESTSUITES)
- set_property(GLOBAL PROPERTY LLVM_LIT_PARAMS)
- set_property(GLOBAL PROPERTY LLVM_LIT_DEPENDS)
- set_property(GLOBAL PROPERTY LLVM_LIT_EXTRA_ARGS)
-
add_subdirectory(${entry} ${projName})
-
- get_property(LLVM_LIT_TESTSUITES GLOBAL PROPERTY LLVM_LIT_TESTSUITES)
- get_property(LLVM_LIT_PARAMS GLOBAL PROPERTY LLVM_LIT_PARAMS)
- get_property(LLVM_LIT_DEPENDS GLOBAL PROPERTY LLVM_LIT_DEPENDS)
- get_property(LLVM_LIT_EXTRA_ARGS GLOBAL PROPERTY LLVM_LIT_EXTRA_ARGS)
-
- list(APPEND RUNTIMES_LIT_TESTSUITES ${LLVM_LIT_TESTSUITES})
- list(APPEND RUNTIMES_LIT_PARAMS ${LLVM_LIT_PARAMS})
- list(APPEND RUNTIMES_LIT_DEPENDS ${LLVM_LIT_DEPENDS})
- list(APPEND RUNTIMES_LIT_EXTRA_ARGS ${LLVM_LIT_EXTRA_ARGS})
endforeach()
if(LLVM_INCLUDE_TESTS)
# Add a global check rule now that all subdirectories have been traversed
# and we know the total set of lit testsuites.
- add_lit_target(check-runtimes
- "Running all regression tests"
- ${RUNTIMES_LIT_TESTSUITES}
- PARAMS ${RUNTIMES_LIT_PARAMS}
- DEPENDS ${RUNTIMES_LIT_DEPENDS}
- ARGS ${RUNTIMES_LIT_EXTRA_ARGS}
- )
- add_custom_target(runtimes-test-depends DEPENDS ${RUNTIMES_LIT_DEPENDS})
+ umbrella_lit_testsuite_end(check-runtimes)
if (NOT HAVE_LLVM_LIT)
# If built by manually invoking cmake on this directory, we don't have
diff --git a/runtimes/Tests.cmake.in b/runtimes/Tests.cmake.in
index 7d76a170a090..8108349bec41 100644
--- a/runtimes/Tests.cmake.in
+++ b/runtimes/Tests.cmake.in
@@ -1,3 +1,3 @@
-set(SUB_LIT_TESTSUITES @RUNTIMES_LIT_TESTSUITES@)
-set(SUB_LIT_PARAMS @RUNTIMES_LIT_PARAMS@)
-set(SUB_LIT_EXTRA_ARGS @RUNTIMES_LIT_EXTRA_ARGS@)
+set(SUB_LIT_TESTSUITES @LLVM_RUNTIMES_LIT_TESTSUITES@)
+set(SUB_LIT_PARAMS @LLVM_RUNTIMES_LIT_PARAMS@)
+set(SUB_LIT_EXTRA_ARGS @LLVM_RUNTIMES_LIT_EXTRA_ARGS@)