Skip to content

Conversation

jurahul
Copy link
Contributor

@jurahul jurahul commented Aug 28, 2025

Change add_lit_testsuites to accept either a set of include or a set of exclude directories and use that to specialize check-llvm-tablegen and check-llvm-filecheck targets to use a trimmed down set of dependencies. The check-llvm-filecheck trimming is just for demonstration purpose to show how > 1 testsuites can have smaller set of dependencies than the default LLVM_TEST_DEPENDS.

Note that building check-llvm-filecheck for example when not all LLVM tools have been built results in warnings like:

llvm-lit: <dir>/llvm-project/llvm/utils/lit/lit/llvm/subst.py:126: note: Did not find lli in <dir>/build/bin
llvm-lit: <dir>/llvm-project/llvm/utils/lit/lit/llvm/subst.py:126: note: Did not find llc_dwarf in <dir>/build/bin
llvm-lit: <dir>/llvm-project/llvm/utils/lit/lit/llvm/subst.py:126: note: Did not find llvm-objcopy in <dir>t/build/bin

but the lit tests run fine since all the dependencies specified do get rebuilt.

@jurahul jurahul marked this pull request as ready for review August 28, 2025 22:45
@llvmbot llvmbot added the cmake Build system in general and CMake in particular label Aug 28, 2025
@@ -2192,13 +2192,39 @@ endfunction()

function(add_lit_testsuites project directory)
if (NOT LLVM_ENABLE_IDE)
cmake_parse_arguments(ARG "EXCLUDE_FROM_CHECK_ALL" "FOLDER;BINARY_DIR" "PARAMS;DEPENDS;ARGS" ${ARGN})
cmake_parse_arguments(ARG "EXCLUDE_FROM_CHECK_ALL" "FOLDER;BINARY_DIR"
"PARAMS;DEPENDS;ARGS;EXCLUDE_DIR;INCLUDE_DIR" ${ARGN})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you use EXCLUDE_DIRS that takes a list of folders instead (similar suggestion for INCLUDE_DIR)? CMake's separate_arguments could help you to split a list of space-separate arguments into semicolon-separated ones.

@joker-eph
Copy link
Collaborator

I'm confused by the title, shouldn't it be instead "Add support to define lit test suites with an include/exclude list of folders" or something like this? I don't see the "dependency" part here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake Build system in general and CMake in particular
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants