llvm.org GIT mirror llvm / 47b984c
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268806 91177308-0d34-0410-b5e6-96231b3b80d8 Justin Bogner 4 years ago
1 changed file(s) with 21 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
10491049 function(add_lit_testsuites project directory)
10501050 if (NOT CMAKE_CONFIGURATION_TYPES)
10511051 cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
1052 file(GLOB_RECURSE litCfg ${directory}/lit*.cfg)
1052
1053 # Search recursively for test directories by assuming anything not
1054 # in a directory called Inputs contains tests.
10531055 set(lit_suites)
1054 foreach(f ${litCfg})
1055 get_filename_component(dir ${f} DIRECTORY)
1056 set(lit_suites ${lit_suites} ${dir})
1057 endforeach()
1058 list(REMOVE_DUPLICATES lit_suites)
1056 file(GLOB to_process ${directory}/*)
1057 while(to_process)
1058 set(cur_to_process ${to_process})
1059 set(to_process)
1060 foreach(lit_suite ${cur_to_process})
1061 if(NOT IS_DIRECTORY ${lit_suite})
1062 continue()
1063 endif()
1064 string(FIND ${lit_suite} Inputs is_inputs)
1065 if (is_inputs EQUAL -1)
1066 list(APPEND lit_suites "${lit_suite}")
1067 file(GLOB subdirs ${lit_suite}/*)
1068 list(APPEND to_process ${subdirs})
1069 endif()
1070 endforeach()
1071 endwhile()
1072
1073 # Now create a check- target for each test directory.
10591074 foreach(dir ${lit_suites})
10601075 string(REPLACE ${directory} "" name_slash ${dir})
10611076 if (name_slash)