Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 1 | configure_lit_site_cfg( |
| 2 | ${CMAKE_CURRENT_SOURCE_DIR}/lit.common.configured.in |
| 3 | ${CMAKE_CURRENT_BINARY_DIR}/lit.common.configured) |
| 4 | |
| 5 | # BlocksRuntime and builtins testsuites are not yet ported to lit. |
| 6 | # add_subdirectory(BlocksRuntime) |
| 7 | # add_subdirectory(builtins) |
| 8 | |
| 9 | set(SANITIZER_COMMON_LIT_TEST_DEPS) |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 10 | if(COMPILER_RT_STANDALONE_BUILD) |
| 11 | add_executable(FileCheck IMPORTED GLOBAL) |
| 12 | set_property(TARGET FileCheck PROPERTY IMPORTED_LOCATION ${LLVM_TOOLS_BINARY_DIR}/FileCheck) |
| 13 | list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS FileCheck) |
| 14 | endif() |
| 15 | |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 16 | # When ANDROID, we build tests with the host compiler (i.e. CMAKE_C_COMPILER), |
| 17 | # and run tests with tools from the host toolchain. |
| 18 | if(NOT ANDROID) |
| 19 | if(NOT COMPILER_RT_STANDALONE_BUILD) |
| 20 | # Use LLVM utils and Clang from the same build tree. |
| 21 | list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS |
| 22 | clang clang-headers FileCheck count not llvm-nm llvm-symbolizer |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 23 | compiler-rt-headers) |
| 24 | if (COMPILER_RT_HAS_PROFILE) |
| 25 | list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS profile) |
| 26 | endif() |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 27 | endif() |
| 28 | if(UNIX) |
| 29 | list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS SanitizerLintCheck) |
| 30 | endif() |
| 31 | endif() |
| 32 | |
| 33 | # Run sanitizer tests only if we're sure that clang would produce |
| 34 | # working binaries. |
| 35 | if(COMPILER_RT_CAN_EXECUTE_TESTS) |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 36 | if(COMPILER_RT_HAS_ASAN) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 37 | add_subdirectory(asan) |
| 38 | endif() |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 39 | if(COMPILER_RT_HAS_DFSAN) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 40 | add_subdirectory(dfsan) |
| 41 | endif() |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 42 | if(COMPILER_RT_HAS_LSAN) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 43 | add_subdirectory(lsan) |
| 44 | endif() |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 45 | if(COMPILER_RT_HAS_MSAN) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 46 | add_subdirectory(msan) |
| 47 | endif() |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 48 | if(COMPILER_RT_HAS_PROFILE) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 49 | add_subdirectory(profile) |
| 50 | endif() |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 51 | if(COMPILER_RT_HAS_SANITIZER_COMMON) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 52 | add_subdirectory(sanitizer_common) |
| 53 | endif() |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 54 | if(COMPILER_RT_HAS_TSAN) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 55 | add_subdirectory(tsan) |
| 56 | endif() |
Stephen Hines | 6d18623 | 2014-11-26 17:56:19 -0800 | [diff] [blame] | 57 | if(COMPILER_RT_HAS_UBSAN) |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 58 | add_subdirectory(ubsan) |
| 59 | endif() |
Stephen Hines | 86277eb | 2015-03-23 12:06:32 -0700 | [diff] [blame] | 60 | add_subdirectory(cfi) |
Pirama Arumuga Nainar | cdce50b | 2015-07-01 12:26:56 -0700 | [diff] [blame] | 61 | if(COMPILER_RT_HAS_SAFESTACK) |
| 62 | add_subdirectory(safestack) |
| 63 | endif() |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 64 | endif() |
| 65 | |
| 66 | if(COMPILER_RT_STANDALONE_BUILD) |
| 67 | # Now that we've traversed all the directories and know all the lit testsuites, |
| 68 | # introduce a rule to run to run all of them. |
| 69 | get_property(LLVM_LIT_TESTSUITES GLOBAL PROPERTY LLVM_LIT_TESTSUITES) |
| 70 | get_property(LLVM_LIT_DEPENDS GLOBAL PROPERTY LLVM_LIT_DEPENDS) |
| 71 | add_lit_target(check-all |
| 72 | "Running all regression tests" |
| 73 | ${LLVM_LIT_TESTSUITES} |
| 74 | DEPENDS ${LLVM_LIT_DEPENDS}) |
| 75 | endif() |