mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
CMake: generate check targets for lit suites without their own lit.cfgs
Currently our cmake generates targets like check-llvm-unit and check-llvm-transforms-loopunroll-x86, but not check-llvm-transforms or check-llvm-transforms-adce. This is because the search for test suites only lists the ones with a custom lit.cfg or lit.local.cfg. Instead, we can do something a little smarter - any directory under test that isn't called Inputs or inside a directory called Inputs is a test suite. llvm-svn: 268806
This commit is contained in:
parent
9b767099e0
commit
6d6bd1c06e
@ -1050,13 +1050,28 @@ endfunction()
|
||||
function(add_lit_testsuites project directory)
|
||||
if (NOT CMAKE_CONFIGURATION_TYPES)
|
||||
cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
|
||||
file(GLOB_RECURSE litCfg ${directory}/lit*.cfg)
|
||||
|
||||
# Search recursively for test directories by assuming anything not
|
||||
# in a directory called Inputs contains tests.
|
||||
set(lit_suites)
|
||||
foreach(f ${litCfg})
|
||||
get_filename_component(dir ${f} DIRECTORY)
|
||||
set(lit_suites ${lit_suites} ${dir})
|
||||
file(GLOB to_process ${directory}/*)
|
||||
while(to_process)
|
||||
set(cur_to_process ${to_process})
|
||||
set(to_process)
|
||||
foreach(lit_suite ${cur_to_process})
|
||||
if(NOT IS_DIRECTORY ${lit_suite})
|
||||
continue()
|
||||
endif()
|
||||
string(FIND ${lit_suite} Inputs is_inputs)
|
||||
if (is_inputs EQUAL -1)
|
||||
list(APPEND lit_suites "${lit_suite}")
|
||||
file(GLOB subdirs ${lit_suite}/*)
|
||||
list(APPEND to_process ${subdirs})
|
||||
endif()
|
||||
endforeach()
|
||||
list(REMOVE_DUPLICATES lit_suites)
|
||||
endwhile()
|
||||
|
||||
# Now create a check- target for each test directory.
|
||||
foreach(dir ${lit_suites})
|
||||
string(REPLACE ${directory} "" name_slash ${dir})
|
||||
if (name_slash)
|
||||
|
Loading…
x
Reference in New Issue
Block a user