Alexey Samsonov | 81a2b46 | 2014-02-14 11:00:07 +0000 | [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) |
Alexey Samsonov | ba869e7 | 2014-02-14 11:42:22 +0000 | [diff] [blame] | 8 | |
Alexey Samsonov | aa980c7 | 2014-02-19 10:04:29 +0000 | [diff] [blame] | 9 | set(SANITIZER_COMMON_LIT_TEST_DEPS) |
Filipe Cabecinhas | a1225be | 2015-02-20 03:41:07 +0000 | [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 | |
Alexey Samsonov | b73db72 | 2014-02-18 07:52:40 +0000 | [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. |
Alexey Samsonov | aa980c7 | 2014-02-19 10:04:29 +0000 | [diff] [blame] | 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 |
Peter Collingbourne | ea08705 | 2015-07-29 18:12:45 +0000 | [diff] [blame] | 22 | clang clang-headers FileCheck count not llvm-config llvm-nm llvm-symbolizer |
Reid Kleckner | 04748b9 | 2014-11-21 23:09:51 +0000 | [diff] [blame] | 23 | compiler-rt-headers) |
| 24 | if (COMPILER_RT_HAS_PROFILE) |
| 25 | list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS profile) |
| 26 | endif() |
Peter Collingbourne | a68d90f | 2015-07-02 22:08:38 +0000 | [diff] [blame] | 27 | if (WIN32) |
| 28 | list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS KillTheDoctor) |
| 29 | endif() |
Alexey Samsonov | aa980c7 | 2014-02-19 10:04:29 +0000 | [diff] [blame] | 30 | endif() |
Alexey Samsonov | b73db72 | 2014-02-18 07:52:40 +0000 | [diff] [blame] | 31 | if(UNIX) |
| 32 | list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS SanitizerLintCheck) |
| 33 | endif() |
| 34 | endif() |
| 35 | |
Alexey Samsonov | ba869e7 | 2014-02-14 11:42:22 +0000 | [diff] [blame] | 36 | # Run sanitizer tests only if we're sure that clang would produce |
| 37 | # working binaries. |
| 38 | if(COMPILER_RT_CAN_EXECUTE_TESTS) |
Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 39 | if(COMPILER_RT_HAS_ASAN) |
Alexey Samsonov | 9f20d67 | 2014-02-14 14:06:10 +0000 | [diff] [blame] | 40 | add_subdirectory(asan) |
| 41 | endif() |
Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 42 | if(COMPILER_RT_HAS_DFSAN) |
Alexey Samsonov | f6cf6ab | 2014-02-14 12:05:41 +0000 | [diff] [blame] | 43 | add_subdirectory(dfsan) |
| 44 | endif() |
Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 45 | if(COMPILER_RT_HAS_LSAN) |
Alexey Samsonov | 7eeef85 | 2014-02-14 12:26:05 +0000 | [diff] [blame] | 46 | add_subdirectory(lsan) |
| 47 | endif() |
Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 48 | if(COMPILER_RT_HAS_MSAN) |
Alexey Samsonov | 8434e60 | 2014-02-14 13:02:58 +0000 | [diff] [blame] | 49 | add_subdirectory(msan) |
| 50 | endif() |
Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 51 | if(COMPILER_RT_HAS_PROFILE) |
Duncan P. N. Exon Smith | ae2f0bb | 2014-03-31 22:45:37 +0000 | [diff] [blame] | 52 | add_subdirectory(profile) |
| 53 | endif() |
Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 54 | if(COMPILER_RT_HAS_SANITIZER_COMMON) |
Alexey Samsonov | 35a66d1 | 2014-02-20 12:18:08 +0000 | [diff] [blame] | 55 | add_subdirectory(sanitizer_common) |
| 56 | endif() |
Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 57 | if(COMPILER_RT_HAS_TSAN) |
Alexey Samsonov | e6a6183 | 2014-02-14 14:35:48 +0000 | [diff] [blame] | 58 | add_subdirectory(tsan) |
| 59 | endif() |
Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 60 | if(COMPILER_RT_HAS_UBSAN) |
Alexey Samsonov | ba869e7 | 2014-02-14 11:42:22 +0000 | [diff] [blame] | 61 | add_subdirectory(ubsan) |
| 62 | endif() |
Alexey Samsonov | 4133c18 | 2015-09-29 21:43:37 +0000 | [diff] [blame] | 63 | # CFI tests require diagnostic mode, which is implemented in UBSan. |
| 64 | if(COMPILER_RT_HAS_UBSAN) |
| 65 | add_subdirectory(cfi) |
| 66 | endif() |
Peter Collingbourne | b64d0b1 | 2015-06-15 21:08:47 +0000 | [diff] [blame] | 67 | if(COMPILER_RT_HAS_SAFESTACK) |
| 68 | add_subdirectory(safestack) |
| 69 | endif() |
Alexey Samsonov | ba869e7 | 2014-02-14 11:42:22 +0000 | [diff] [blame] | 70 | endif() |
Alexey Samsonov | 04e7ad2 | 2014-02-20 12:36:26 +0000 | [diff] [blame] | 71 | |
| 72 | if(COMPILER_RT_STANDALONE_BUILD) |
| 73 | # Now that we've traversed all the directories and know all the lit testsuites, |
| 74 | # introduce a rule to run to run all of them. |
| 75 | get_property(LLVM_LIT_TESTSUITES GLOBAL PROPERTY LLVM_LIT_TESTSUITES) |
| 76 | get_property(LLVM_LIT_DEPENDS GLOBAL PROPERTY LLVM_LIT_DEPENDS) |
| 77 | add_lit_target(check-all |
| 78 | "Running all regression tests" |
| 79 | ${LLVM_LIT_TESTSUITES} |
| 80 | DEPENDS ${LLVM_LIT_DEPENDS}) |
| 81 | endif() |