| 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 | 
|  | 22 | clang clang-headers FileCheck count not 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() | 
| Alexey Samsonov | aa980c7 | 2014-02-19 10:04:29 +0000 | [diff] [blame] | 27 | endif() | 
| Alexey Samsonov | b73db72 | 2014-02-18 07:52:40 +0000 | [diff] [blame] | 28 | if(UNIX) | 
|  | 29 | list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS SanitizerLintCheck) | 
|  | 30 | endif() | 
|  | 31 | endif() | 
|  | 32 |  | 
| Alexey Samsonov | ba869e7 | 2014-02-14 11:42:22 +0000 | [diff] [blame] | 33 | # Run sanitizer tests only if we're sure that clang would produce | 
|  | 34 | # working binaries. | 
|  | 35 | if(COMPILER_RT_CAN_EXECUTE_TESTS) | 
| Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 36 | if(COMPILER_RT_HAS_ASAN) | 
| Alexey Samsonov | 9f20d67 | 2014-02-14 14:06:10 +0000 | [diff] [blame] | 37 | add_subdirectory(asan) | 
|  | 38 | endif() | 
| Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 39 | if(COMPILER_RT_HAS_DFSAN) | 
| Alexey Samsonov | f6cf6ab | 2014-02-14 12:05:41 +0000 | [diff] [blame] | 40 | add_subdirectory(dfsan) | 
|  | 41 | endif() | 
| Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 42 | if(COMPILER_RT_HAS_LSAN) | 
| Alexey Samsonov | 7eeef85 | 2014-02-14 12:26:05 +0000 | [diff] [blame] | 43 | add_subdirectory(lsan) | 
|  | 44 | endif() | 
| Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 45 | if(COMPILER_RT_HAS_MSAN) | 
| Alexey Samsonov | 8434e60 | 2014-02-14 13:02:58 +0000 | [diff] [blame] | 46 | add_subdirectory(msan) | 
|  | 47 | endif() | 
| Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 48 | if(COMPILER_RT_HAS_PROFILE) | 
| Duncan P. N. Exon Smith | ae2f0bb | 2014-03-31 22:45:37 +0000 | [diff] [blame] | 49 | add_subdirectory(profile) | 
|  | 50 | endif() | 
| Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 51 | if(COMPILER_RT_HAS_SANITIZER_COMMON) | 
| Alexey Samsonov | 35a66d1 | 2014-02-20 12:18:08 +0000 | [diff] [blame] | 52 | add_subdirectory(sanitizer_common) | 
|  | 53 | endif() | 
| Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 54 | if(COMPILER_RT_HAS_TSAN) | 
| Alexey Samsonov | e6a6183 | 2014-02-14 14:35:48 +0000 | [diff] [blame] | 55 | add_subdirectory(tsan) | 
|  | 56 | endif() | 
| Alexey Samsonov | 68b9e74 | 2014-08-08 22:01:20 +0000 | [diff] [blame] | 57 | if(COMPILER_RT_HAS_UBSAN) | 
| Alexey Samsonov | ba869e7 | 2014-02-14 11:42:22 +0000 | [diff] [blame] | 58 | add_subdirectory(ubsan) | 
|  | 59 | endif() | 
|  | 60 | endif() | 
| Alexey Samsonov | 04e7ad2 | 2014-02-20 12:36:26 +0000 | [diff] [blame] | 61 |  | 
|  | 62 | if(COMPILER_RT_STANDALONE_BUILD) | 
|  | 63 | # Now that we've traversed all the directories and know all the lit testsuites, | 
|  | 64 | # introduce a rule to run to run all of them. | 
|  | 65 | get_property(LLVM_LIT_TESTSUITES GLOBAL PROPERTY LLVM_LIT_TESTSUITES) | 
|  | 66 | get_property(LLVM_LIT_DEPENDS GLOBAL PROPERTY LLVM_LIT_DEPENDS) | 
|  | 67 | add_lit_target(check-all | 
|  | 68 | "Running all regression tests" | 
|  | 69 | ${LLVM_LIT_TESTSUITES} | 
|  | 70 | DEPENDS ${LLVM_LIT_DEPENDS}) | 
|  | 71 | endif() |