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 | |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 25 | include(FindPythonInterp) |
| 26 | if(PYTHONINTERP_FOUND) |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 27 | get_target_triple(TARGET_TRIPLE) |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 28 | get_target_property(LLVM_TOOLS_PATH clang RUNTIME_OUTPUT_DIRECTORY) |
Daniel Dunbar | 9e10cc7 | 2009-09-26 07:36:09 +0000 | [diff] [blame] | 29 | get_target_property(LLVM_LIBS_PATH clang LIBRARY_OUTPUT_DIRECTORY) |
Douglas Gregor | ebfc180 | 2009-06-16 20:13:51 +0000 | [diff] [blame] | 30 | set(CLANG_TEST_EXTRA_ARGS) |
| 31 | if (MSVC OR XCODE) |
| 32 | set(CLANG_TEST_EXTRA_ARGS "--no-progress-bar") |
| 33 | endif() |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 34 | |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 35 | foreach(testdir ${CLANG_TEST_DIRECTORIES}) |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 36 | add_custom_target(clang-test-${testdir} |
Daniel Dunbar | 1b720a9 | 2009-09-20 19:04:35 +0000 | [diff] [blame] | 37 | COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#" |
| 38 | -e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#" |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 39 | -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}#" |
Daniel Dunbar | 9e10cc7 | 2009-09-26 07:36:09 +0000 | [diff] [blame] | 40 | -e "s#\@LLVM_LIBS_DIR\@#${LLVM_LIBS_PATH}/${CMAKE_CFG_INTDIR}#" |
Daniel Dunbar | 1b720a9 | 2009-09-20 19:04:35 +0000 | [diff] [blame] | 41 | -e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#" |
| 42 | -e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#" |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 43 | -e "s#\@TARGET_TRIPLE\@#${TARGET_TRIPLE}#" |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 44 | ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in > |
| 45 | ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 46 | COMMAND ${PYTHON_EXECUTABLE} |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 47 | ${LLVM_SOURCE_DIR}/utils/lit/lit.py |
Daniel Dunbar | b258d8f | 2009-11-05 16:36:19 +0000 | [diff] [blame] | 48 | --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg |
Daniel Dunbar | 584425c | 2009-09-24 07:18:36 +0000 | [diff] [blame] | 49 | -sv ${CLANG_TEST_EXTRA_ARGS} |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 50 | ${CMAKE_CURRENT_BINARY_DIR}/${testdir} |
Douglas Gregor | 52e7108 | 2009-10-16 18:18:30 +0000 | [diff] [blame] | 51 | DEPENDS clang clang-cc index-test c-index-test |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 52 | COMMENT "Running Clang regression tests in ${testdir}") |
Douglas Gregor | f5dba38 | 2009-06-05 16:26:18 +0000 | [diff] [blame] | 53 | endforeach() |
Douglas Gregor | eb357b6 | 2009-06-05 16:00:31 +0000 | [diff] [blame] | 54 | |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 55 | add_custom_target(clang-test |
Daniel Dunbar | 1b720a9 | 2009-09-20 19:04:35 +0000 | [diff] [blame] | 56 | COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#" |
| 57 | -e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#" |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 58 | -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}#" |
Daniel Dunbar | 9e10cc7 | 2009-09-26 07:36:09 +0000 | [diff] [blame] | 59 | -e "s#\@LLVM_LIBS_DIR\@#${LLVM_LIBS_PATH}/${CMAKE_CFG_INTDIR}#" |
Daniel Dunbar | 1b720a9 | 2009-09-20 19:04:35 +0000 | [diff] [blame] | 60 | -e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#" |
| 61 | -e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#" |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 62 | -e "s#\@TARGET_TRIPLE\@#${TARGET_TRIPLE}#" |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 63 | ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in > |
| 64 | ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 65 | COMMAND ${PYTHON_EXECUTABLE} |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 66 | ${LLVM_SOURCE_DIR}/utils/lit/lit.py |
Daniel Dunbar | b258d8f | 2009-11-05 16:36:19 +0000 | [diff] [blame] | 67 | --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg |
Daniel Dunbar | 584425c | 2009-09-24 07:18:36 +0000 | [diff] [blame] | 68 | -sv ${CLANG_TEST_EXTRA_ARGS} |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 69 | ${CMAKE_CURRENT_BINARY_DIR} |
Douglas Gregor | 52e7108 | 2009-10-16 18:18:30 +0000 | [diff] [blame] | 70 | DEPENDS clang clang-cc index-test c-index-test |
Daniel Dunbar | 7af18d3 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 71 | COMMENT "Running Clang regression tests") |
Daniel Dunbar | cceef8b | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 72 | |
| 73 | add_custom_target(clang-c++tests |
| 74 | COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#" |
| 75 | -e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#" |
| 76 | -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}#" |
Daniel Dunbar | 9e10cc7 | 2009-09-26 07:36:09 +0000 | [diff] [blame] | 77 | -e "s#\@LLVM_LIBS_DIR\@#${LLVM_LIBS_PATH}/${CMAKE_CFG_INTDIR}#" |
Daniel Dunbar | cceef8b | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 78 | -e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#" |
| 79 | -e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#" |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 80 | -e "s#\@TARGET_TRIPLE\@#${TARGET_TRIPLE}#" |
Daniel Dunbar | cceef8b | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 81 | ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in > |
| 82 | ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 83 | COMMAND ${PYTHON_EXECUTABLE} |
Daniel Dunbar | cceef8b | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 84 | ${LLVM_SOURCE_DIR}/utils/lit/lit.py |
Daniel Dunbar | b258d8f | 2009-11-05 16:36:19 +0000 | [diff] [blame] | 85 | --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg |
Daniel Dunbar | 584425c | 2009-09-24 07:18:36 +0000 | [diff] [blame] | 86 | -sv ${CLANG_TEST_EXTRA_ARGS} |
Daniel Dunbar | cceef8b | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 87 | ${CMAKE_CURRENT_SOURCE_DIR}/../utils/C++Tests |
Douglas Gregor | 52e7108 | 2009-10-16 18:18:30 +0000 | [diff] [blame] | 88 | DEPENDS clang clang-cc index-test c-index-test |
Daniel Dunbar | cceef8b | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 89 | COMMENT "Running Clang regression tests") |
Daniel Dunbar | e9a7323 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 90 | endif() |