Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 1 | set(CLANG_TEST_DIRECTORIES |
| 2 | "Analysis" |
Douglas Gregor | 81b747b | 2009-09-17 21:32:03 +0000 | [diff] [blame] | 3 | "CodeCompletion" |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 4 | "CodeGen" |
| 5 | "CodeGenCXX" |
| 6 | "CodeGenObjC" |
| 7 | "Coverage" |
Douglas Gregor | ebfc180 | 2009-06-16 20:13:51 +0000 | [diff] [blame] | 8 | "CXX" |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 9 | "Driver" |
| 10 | "FixIt" |
| 11 | "Frontend" |
Ted Kremenek | f7507f2 | 2010-03-08 23:38:27 +0000 | [diff] [blame] | 12 | "Headers" |
Douglas Gregor | 2e22253 | 2009-07-02 17:08:52 +0000 | [diff] [blame] | 13 | "Index" |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 14 | "Lexer" |
| 15 | "Misc" |
| 16 | "PCH" |
| 17 | "Parser" |
| 18 | "Preprocessor" |
| 19 | "Rewriter" |
| 20 | "Sema" |
| 21 | "SemaCXX" |
| 22 | "SemaObjC" |
| 23 | "SemaObjCXX" |
| 24 | "SemaTemplate") |
Douglas Gregor | eb357b6 | 2009-06-05 16:00:31 +0000 | [diff] [blame] | 25 | |
Daniel Dunbar | 1e63492 | 2009-11-07 23:53:32 +0000 | [diff] [blame] | 26 | set(LLVM_SOURCE_DIR "${LLVM_MAIN_SRC_DIR}") |
| 27 | set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}") |
Daniel Dunbar | 30eb055 | 2009-11-08 09:46:39 +0000 | [diff] [blame] | 28 | set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s") |
| 29 | set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib/%(build_config)s") |
Daniel Dunbar | 1e63492 | 2009-11-07 23:53:32 +0000 | [diff] [blame] | 30 | set(CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..") |
| 31 | set(CLANG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..") |
| 32 | |
| 33 | configure_file( |
| 34 | ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in |
| 35 | ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) |
| 36 | |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 37 | include(FindPythonInterp) |
| 38 | if(PYTHONINTERP_FOUND) |
Douglas Gregor | ebfc180 | 2009-06-16 20:13:51 +0000 | [diff] [blame] | 39 | set(CLANG_TEST_EXTRA_ARGS) |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 40 | |
Daniel Dunbar | e33f82f | 2009-11-22 21:55:22 +0000 | [diff] [blame] | 41 | option(CLANG_TEST_USE_VG "Run Clang tests under Valgrind" OFF) |
| 42 | if(CLANG_TEST_USE_VG) |
| 43 | set(CLANG_TEST_EXTRA_ARGS ${CLANG_TEST_EXTRA_ARGS} "--vg") |
| 44 | endif () |
| 45 | |
NAKAMURA Takumi | c84aca4 | 2010-11-11 04:09:51 +0000 | [diff] [blame] | 46 | set(LIT_ARGS "${CLANG_TEST_EXTRA_ARGS} ${LLVM_LIT_ARGS}") |
| 47 | separate_arguments(LIT_ARGS) |
| 48 | |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 49 | foreach(testdir ${CLANG_TEST_DIRECTORIES}) |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 50 | add_custom_target(clang-test-${testdir} |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 51 | COMMAND ${PYTHON_EXECUTABLE} |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 52 | ${LLVM_SOURCE_DIR}/utils/lit/lit.py |
Daniel Dunbar | b258d8f | 2009-11-05 16:36:19 +0000 | [diff] [blame] | 53 | --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg |
Daniel Dunbar | 1e63492 | 2009-11-07 23:53:32 +0000 | [diff] [blame] | 54 | --param build_config=${CMAKE_CFG_INTDIR} |
NAKAMURA Takumi | c84aca4 | 2010-11-11 04:09:51 +0000 | [diff] [blame] | 55 | ${LIT_ARGS} |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 56 | ${CMAKE_CURRENT_BINARY_DIR}/${testdir} |
Daniel Dunbar | 2b1acd4 | 2010-07-29 22:57:17 +0000 | [diff] [blame] | 57 | DEPENDS clang c-index-test FileCheck not count |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 58 | COMMENT "Running Clang regression tests in ${testdir}") |
Douglas Gregor | f5dba38 | 2009-06-05 16:26:18 +0000 | [diff] [blame] | 59 | endforeach() |
Douglas Gregor | eb357b6 | 2009-06-05 16:00:31 +0000 | [diff] [blame] | 60 | |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 61 | add_custom_target(clang-test |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 62 | COMMAND ${PYTHON_EXECUTABLE} |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 63 | ${LLVM_SOURCE_DIR}/utils/lit/lit.py |
Daniel Dunbar | b258d8f | 2009-11-05 16:36:19 +0000 | [diff] [blame] | 64 | --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg |
Daniel Dunbar | 1e63492 | 2009-11-07 23:53:32 +0000 | [diff] [blame] | 65 | --param build_config=${CMAKE_CFG_INTDIR} |
NAKAMURA Takumi | c84aca4 | 2010-11-11 04:09:51 +0000 | [diff] [blame] | 66 | ${LIT_ARGS} |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 67 | ${CMAKE_CURRENT_BINARY_DIR} |
Daniel Dunbar | 2b1acd4 | 2010-07-29 22:57:17 +0000 | [diff] [blame] | 68 | DEPENDS clang c-index-test FileCheck not count |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 69 | COMMENT "Running Clang regression tests") |
Daniel Dunbar | cceef8b | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 70 | |
| 71 | add_custom_target(clang-c++tests |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 72 | COMMAND ${PYTHON_EXECUTABLE} |
Daniel Dunbar | cceef8b | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 73 | ${LLVM_SOURCE_DIR}/utils/lit/lit.py |
Daniel Dunbar | b258d8f | 2009-11-05 16:36:19 +0000 | [diff] [blame] | 74 | --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg |
Daniel Dunbar | 1e63492 | 2009-11-07 23:53:32 +0000 | [diff] [blame] | 75 | --param build_config=${CMAKE_CFG_INTDIR} |
NAKAMURA Takumi | c84aca4 | 2010-11-11 04:09:51 +0000 | [diff] [blame] | 76 | ${LIT_ARGS} |
Daniel Dunbar | cceef8b | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 77 | ${CMAKE_CURRENT_SOURCE_DIR}/../utils/C++Tests |
Daniel Dunbar | 2b1acd4 | 2010-07-29 22:57:17 +0000 | [diff] [blame] | 78 | DEPENDS clang c-index-test FileCheck not count |
Daniel Dunbar | cceef8b | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 79 | COMMENT "Running Clang regression tests") |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 80 | endif() |