1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[CMake] Rename EXCLUDE_FROM_ALL and make it an argument to add_lit_testsuite

EXCLUDE_FROM_ALL means something else for add_lit_testsuite as it does
for something like add_executable. Distinguish between the two by
renaming the variable and making it an argument to add_lit_testsuite.

Differential revision: https://reviews.llvm.org/D74168
This commit is contained in:
Jonas Devlieghere 2020-02-06 15:26:10 -08:00
parent 37c308cd68
commit 9c01d9f98b
2 changed files with 12 additions and 8 deletions

View File

@ -1560,10 +1560,10 @@ endfunction()
# A function to add a set of lit test suites to be driven through 'check-*' targets.
function(add_lit_testsuite target comment)
cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
cmake_parse_arguments(ARG "EXCLUDE_FROM_CHECK_ALL" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
# EXCLUDE_FROM_ALL excludes the test ${target} out of check-all.
if(NOT EXCLUDE_FROM_ALL)
if(NOT ARG_EXCLUDE_FROM_CHECK_ALL)
# Register the testsuites, params and depends for the global check rule.
set_property(GLOBAL APPEND PROPERTY LLVM_LIT_TESTSUITES ${ARG_UNPARSED_ARGUMENTS})
set_property(GLOBAL APPEND PROPERTY LLVM_LIT_PARAMS ${ARG_PARAMS})
@ -1582,7 +1582,7 @@ endfunction()
function(add_lit_testsuites project directory)
if (NOT LLVM_ENABLE_IDE)
cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
cmake_parse_arguments(ARG "EXCLUDE_FROM_CHECK_ALL" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
# Search recursively for test directories by assuming anything not
# in a directory called Inputs contains tests.
@ -1605,6 +1605,7 @@ function(add_lit_testsuites project directory)
string(TOLOWER "${project}${name_dashes}" name_var)
add_lit_target("check-${name_var}" "Running lit suite ${lit_suite}"
${lit_suite}
${EXCLUDE_FROM_CHECK_ALL}
PARAMS ${ARG_PARAMS}
DEPENDS ${ARG_DEPENDS}
ARGS ${ARG_ARGS}

View File

@ -30,11 +30,6 @@ configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.cfg.py
)
# Don't include check-llvm into check-all without LLVM_BUILD_TOOLS.
if(NOT LLVM_BUILD_TOOLS)
set(EXCLUDE_FROM_ALL ON)
endif()
# Set the depends list as a variable so that it can grow conditionally.
# NOTE: Sync the substitutions in test/lit.cfg when adding to this list.
set(LLVM_TEST_DEPENDS
@ -173,13 +168,21 @@ endif()
add_custom_target(llvm-test-depends DEPENDS ${LLVM_TEST_DEPENDS})
set_target_properties(llvm-test-depends PROPERTIES FOLDER "Tests")
if(LLVM_BUILD_TOOLS)
set(exclude_from_check_all "EXCLUDE_FROM_CHECK_ALL")
else()
set(exclude_from_check_all "")
endif()
add_lit_testsuite(check-llvm "Running the LLVM regression tests"
${CMAKE_CURRENT_BINARY_DIR}
${exclude_from_check_all}
DEPENDS ${LLVM_TEST_DEPENDS}
)
set_target_properties(check-llvm PROPERTIES FOLDER "Tests")
add_lit_testsuites(LLVM ${CMAKE_CURRENT_SOURCE_DIR}
${exclude_from_check_all}
DEPENDS ${LLVM_TEST_DEPENDS}
)