blob: dd3cbe9add5d782f2422443d5da471672674817e [file] [log] [blame]
Alexey Samsonov81a2b462014-02-14 11:00:07 +00001configure_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 Samsonovba869e72014-02-14 11:42:22 +00008
Alexey Samsonovaa980c72014-02-19 10:04:29 +00009set(SANITIZER_COMMON_LIT_TEST_DEPS)
Filipe Cabecinhasa1225be2015-02-20 03:41:07 +000010if(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)
14endif()
15
Alexey Samsonovb73db722014-02-18 07:52:40 +000016# 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 Samsonovaa980c72014-02-19 10:04:29 +000018if(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 Kleckner04748b92014-11-21 23:09:51 +000023 compiler-rt-headers)
24 if (COMPILER_RT_HAS_PROFILE)
25 list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS profile)
26 endif()
Alexey Samsonovaa980c72014-02-19 10:04:29 +000027 endif()
Alexey Samsonovb73db722014-02-18 07:52:40 +000028 if(UNIX)
29 list(APPEND SANITIZER_COMMON_LIT_TEST_DEPS SanitizerLintCheck)
30 endif()
31endif()
32
Alexey Samsonovba869e72014-02-14 11:42:22 +000033# Run sanitizer tests only if we're sure that clang would produce
34# working binaries.
35if(COMPILER_RT_CAN_EXECUTE_TESTS)
Alexey Samsonov68b9e742014-08-08 22:01:20 +000036 if(COMPILER_RT_HAS_ASAN)
Alexey Samsonov9f20d672014-02-14 14:06:10 +000037 add_subdirectory(asan)
38 endif()
Alexey Samsonov68b9e742014-08-08 22:01:20 +000039 if(COMPILER_RT_HAS_DFSAN)
Alexey Samsonovf6cf6ab2014-02-14 12:05:41 +000040 add_subdirectory(dfsan)
41 endif()
Alexey Samsonov68b9e742014-08-08 22:01:20 +000042 if(COMPILER_RT_HAS_LSAN)
Alexey Samsonov7eeef852014-02-14 12:26:05 +000043 add_subdirectory(lsan)
44 endif()
Alexey Samsonov68b9e742014-08-08 22:01:20 +000045 if(COMPILER_RT_HAS_MSAN)
Alexey Samsonov8434e602014-02-14 13:02:58 +000046 add_subdirectory(msan)
47 endif()
Alexey Samsonov68b9e742014-08-08 22:01:20 +000048 if(COMPILER_RT_HAS_PROFILE)
Duncan P. N. Exon Smithae2f0bb2014-03-31 22:45:37 +000049 add_subdirectory(profile)
50 endif()
Alexey Samsonov68b9e742014-08-08 22:01:20 +000051 if(COMPILER_RT_HAS_SANITIZER_COMMON)
Alexey Samsonov35a66d12014-02-20 12:18:08 +000052 add_subdirectory(sanitizer_common)
53 endif()
Alexey Samsonov68b9e742014-08-08 22:01:20 +000054 if(COMPILER_RT_HAS_TSAN)
Alexey Samsonove6a61832014-02-14 14:35:48 +000055 add_subdirectory(tsan)
56 endif()
Alexey Samsonov68b9e742014-08-08 22:01:20 +000057 if(COMPILER_RT_HAS_UBSAN)
Alexey Samsonovba869e72014-02-14 11:42:22 +000058 add_subdirectory(ubsan)
59 endif()
60endif()
Alexey Samsonov04e7ad22014-02-20 12:36:26 +000061
62if(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})
71endif()