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" |
Douglas Gregor | 2e22253 | 2009-07-02 17:08:52 +0000 | [diff] [blame] | 12 | "Index" |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 13 | "Lexer" |
| 14 | "Misc" |
| 15 | "PCH" |
| 16 | "Parser" |
| 17 | "Preprocessor" |
| 18 | "Rewriter" |
| 19 | "Sema" |
| 20 | "SemaCXX" |
| 21 | "SemaObjC" |
| 22 | "SemaObjCXX" |
| 23 | "SemaTemplate") |
Douglas Gregor | eb357b6 | 2009-06-05 16:00:31 +0000 | [diff] [blame] | 24 | |
Daniel Dunbar | 1e63492 | 2009-11-07 23:53:32 +0000 | [diff] [blame] | 25 | set(LLVM_SOURCE_DIR "${LLVM_MAIN_SRC_DIR}") |
| 26 | set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}") |
Daniel Dunbar | 30eb055 | 2009-11-08 09:46:39 +0000 | [diff] [blame] | 27 | set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s") |
| 28 | set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib/%(build_config)s") |
Daniel Dunbar | 1e63492 | 2009-11-07 23:53:32 +0000 | [diff] [blame] | 29 | set(CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..") |
| 30 | set(CLANG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..") |
| 31 | |
| 32 | configure_file( |
| 33 | ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in |
| 34 | ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) |
| 35 | |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 36 | include(FindPythonInterp) |
| 37 | if(PYTHONINTERP_FOUND) |
Douglas Gregor | ebfc180 | 2009-06-16 20:13:51 +0000 | [diff] [blame] | 38 | set(CLANG_TEST_EXTRA_ARGS) |
| 39 | if (MSVC OR XCODE) |
| 40 | set(CLANG_TEST_EXTRA_ARGS "--no-progress-bar") |
| 41 | endif() |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 42 | |
Daniel Dunbar | e33f82f | 2009-11-22 21:55:22 +0000 | [diff] [blame] | 43 | option(CLANG_TEST_USE_VG "Run Clang tests under Valgrind" OFF) |
| 44 | if(CLANG_TEST_USE_VG) |
| 45 | set(CLANG_TEST_EXTRA_ARGS ${CLANG_TEST_EXTRA_ARGS} "--vg") |
| 46 | endif () |
| 47 | |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 48 | foreach(testdir ${CLANG_TEST_DIRECTORIES}) |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 49 | add_custom_target(clang-test-${testdir} |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 50 | COMMAND ${PYTHON_EXECUTABLE} |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 51 | ${LLVM_SOURCE_DIR}/utils/lit/lit.py |
Daniel Dunbar | b258d8f | 2009-11-05 16:36:19 +0000 | [diff] [blame] | 52 | --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg |
Daniel Dunbar | 1e63492 | 2009-11-07 23:53:32 +0000 | [diff] [blame] | 53 | --param build_config=${CMAKE_CFG_INTDIR} |
Daniel Dunbar | 584425c | 2009-09-24 07:18:36 +0000 | [diff] [blame] | 54 | -sv ${CLANG_TEST_EXTRA_ARGS} |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 55 | ${CMAKE_CURRENT_BINARY_DIR}/${testdir} |
Chandler Carruth | dbdad6d | 2010-01-26 05:36:44 +0000 | [diff] [blame] | 56 | DEPENDS clang c-index-test |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 57 | COMMENT "Running Clang regression tests in ${testdir}") |
Douglas Gregor | f5dba38 | 2009-06-05 16:26:18 +0000 | [diff] [blame] | 58 | endforeach() |
Douglas Gregor | eb357b6 | 2009-06-05 16:00:31 +0000 | [diff] [blame] | 59 | |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 60 | add_custom_target(clang-test |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 61 | COMMAND ${PYTHON_EXECUTABLE} |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 62 | ${LLVM_SOURCE_DIR}/utils/lit/lit.py |
Daniel Dunbar | b258d8f | 2009-11-05 16:36:19 +0000 | [diff] [blame] | 63 | --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg |
Daniel Dunbar | 1e63492 | 2009-11-07 23:53:32 +0000 | [diff] [blame] | 64 | --param build_config=${CMAKE_CFG_INTDIR} |
Daniel Dunbar | 584425c | 2009-09-24 07:18:36 +0000 | [diff] [blame] | 65 | -sv ${CLANG_TEST_EXTRA_ARGS} |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 66 | ${CMAKE_CURRENT_BINARY_DIR} |
Chandler Carruth | dbdad6d | 2010-01-26 05:36:44 +0000 | [diff] [blame] | 67 | DEPENDS clang c-index-test |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 68 | COMMENT "Running Clang regression tests") |
Daniel Dunbar | cceef8b | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 69 | |
| 70 | add_custom_target(clang-c++tests |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 71 | COMMAND ${PYTHON_EXECUTABLE} |
Daniel Dunbar | cceef8b | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 72 | ${LLVM_SOURCE_DIR}/utils/lit/lit.py |
Daniel Dunbar | b258d8f | 2009-11-05 16:36:19 +0000 | [diff] [blame] | 73 | --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg |
Daniel Dunbar | 1e63492 | 2009-11-07 23:53:32 +0000 | [diff] [blame] | 74 | --param build_config=${CMAKE_CFG_INTDIR} |
Daniel Dunbar | 584425c | 2009-09-24 07:18:36 +0000 | [diff] [blame] | 75 | -sv ${CLANG_TEST_EXTRA_ARGS} |
Daniel Dunbar | cceef8b | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 76 | ${CMAKE_CURRENT_SOURCE_DIR}/../utils/C++Tests |
Chandler Carruth | dbdad6d | 2010-01-26 05:36:44 +0000 | [diff] [blame] | 77 | DEPENDS clang c-index-test |
Daniel Dunbar | cceef8b | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 78 | COMMENT "Running Clang regression tests") |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 79 | endif() |