| Douglas Gregor | 30018a6 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 1 | set(CLANG_TEST_DIRECTORIES | 
|  | 2 | "Analysis" | 
| Douglas Gregor | 2436e71 | 2009-09-17 21:32:03 +0000 | [diff] [blame] | 3 | "CodeCompletion" | 
| Douglas Gregor | 30018a6 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 4 | "CodeGen" | 
|  | 5 | "CodeGenCXX" | 
|  | 6 | "CodeGenObjC" | 
|  | 7 | "Coverage" | 
| Douglas Gregor | 274a6b4 | 2009-06-16 20:13:51 +0000 | [diff] [blame] | 8 | "CXX" | 
| Douglas Gregor | 30018a6 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 9 | "Driver" | 
|  | 10 | "FixIt" | 
|  | 11 | "Frontend" | 
| Ted Kremenek | 8590544 | 2010-03-08 23:38:27 +0000 | [diff] [blame] | 12 | "Headers" | 
| Douglas Gregor | c6d5edd | 2009-07-02 17:08:52 +0000 | [diff] [blame] | 13 | "Index" | 
| Douglas Gregor | 30018a6 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 14 | "Lexer" | 
|  | 15 | "Misc" | 
|  | 16 | "PCH" | 
|  | 17 | "Parser" | 
|  | 18 | "Preprocessor" | 
|  | 19 | "Rewriter" | 
|  | 20 | "Sema" | 
| Peter Collingbourne | 6ab610c | 2010-12-01 03:15:31 +0000 | [diff] [blame^] | 21 | "SemaCUDA" | 
| Douglas Gregor | 30018a6 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 22 | "SemaCXX" | 
|  | 23 | "SemaObjC" | 
|  | 24 | "SemaObjCXX" | 
|  | 25 | "SemaTemplate") | 
| Douglas Gregor | 0770532 | 2009-06-05 16:00:31 +0000 | [diff] [blame] | 26 |  | 
| Daniel Dunbar | 0669670 | 2009-11-07 23:53:32 +0000 | [diff] [blame] | 27 | set(LLVM_SOURCE_DIR "${LLVM_MAIN_SRC_DIR}") | 
|  | 28 | set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}") | 
| Daniel Dunbar | 3b339a3 | 2009-11-08 09:46:39 +0000 | [diff] [blame] | 29 | set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s") | 
|  | 30 | set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib/%(build_config)s") | 
| Daniel Dunbar | 0669670 | 2009-11-07 23:53:32 +0000 | [diff] [blame] | 31 | set(CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..") | 
|  | 32 | set(CLANG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..") | 
|  | 33 |  | 
|  | 34 | configure_file( | 
|  | 35 | ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in | 
|  | 36 | ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg) | 
|  | 37 |  | 
| Douglas Gregor | 30018a6 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 38 | include(FindPythonInterp) | 
|  | 39 | if(PYTHONINTERP_FOUND) | 
| Douglas Gregor | 274a6b4 | 2009-06-16 20:13:51 +0000 | [diff] [blame] | 40 | set(CLANG_TEST_EXTRA_ARGS) | 
| Douglas Gregor | 30018a6 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 41 |  | 
| Daniel Dunbar | 7b8fcad | 2009-11-22 21:55:22 +0000 | [diff] [blame] | 42 | option(CLANG_TEST_USE_VG "Run Clang tests under Valgrind" OFF) | 
|  | 43 | if(CLANG_TEST_USE_VG) | 
|  | 44 | set(CLANG_TEST_EXTRA_ARGS ${CLANG_TEST_EXTRA_ARGS} "--vg") | 
|  | 45 | endif () | 
|  | 46 |  | 
| NAKAMURA Takumi | 78e3fdb | 2010-11-11 04:09:51 +0000 | [diff] [blame] | 47 | set(LIT_ARGS "${CLANG_TEST_EXTRA_ARGS} ${LLVM_LIT_ARGS}") | 
|  | 48 | separate_arguments(LIT_ARGS) | 
|  | 49 |  | 
| Daniel Dunbar | ecac0a4 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 50 | foreach(testdir ${CLANG_TEST_DIRECTORIES}) | 
| Daniel Dunbar | a3b52d7 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 51 | add_custom_target(clang-test-${testdir} | 
| Daniel Dunbar | a3b52d7 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 52 | COMMAND ${PYTHON_EXECUTABLE} | 
| Daniel Dunbar | ecac0a4 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 53 | ${LLVM_SOURCE_DIR}/utils/lit/lit.py | 
| Daniel Dunbar | d3f630f | 2009-11-05 16:36:19 +0000 | [diff] [blame] | 54 | --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg | 
| Daniel Dunbar | 0669670 | 2009-11-07 23:53:32 +0000 | [diff] [blame] | 55 | --param build_config=${CMAKE_CFG_INTDIR} | 
| NAKAMURA Takumi | 78e3fdb | 2010-11-11 04:09:51 +0000 | [diff] [blame] | 56 | ${LIT_ARGS} | 
| Daniel Dunbar | ecac0a4 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 57 | ${CMAKE_CURRENT_BINARY_DIR}/${testdir} | 
| Daniel Dunbar | 328913c | 2010-07-29 22:57:17 +0000 | [diff] [blame] | 58 | DEPENDS clang c-index-test FileCheck not count | 
| Daniel Dunbar | ecac0a4 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 59 | COMMENT "Running Clang regression tests in ${testdir}") | 
| Douglas Gregor | fa93480 | 2009-06-05 16:26:18 +0000 | [diff] [blame] | 60 | endforeach() | 
| Douglas Gregor | 0770532 | 2009-06-05 16:00:31 +0000 | [diff] [blame] | 61 |  | 
| Douglas Gregor | 30018a6 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 62 | add_custom_target(clang-test | 
| Daniel Dunbar | a3b52d7 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 63 | COMMAND ${PYTHON_EXECUTABLE} | 
| Daniel Dunbar | ecac0a4 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 64 | ${LLVM_SOURCE_DIR}/utils/lit/lit.py | 
| Daniel Dunbar | d3f630f | 2009-11-05 16:36:19 +0000 | [diff] [blame] | 65 | --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg | 
| Daniel Dunbar | 0669670 | 2009-11-07 23:53:32 +0000 | [diff] [blame] | 66 | --param build_config=${CMAKE_CFG_INTDIR} | 
| NAKAMURA Takumi | 78e3fdb | 2010-11-11 04:09:51 +0000 | [diff] [blame] | 67 | ${LIT_ARGS} | 
| Daniel Dunbar | ecac0a4 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 68 | ${CMAKE_CURRENT_BINARY_DIR} | 
| Daniel Dunbar | 328913c | 2010-07-29 22:57:17 +0000 | [diff] [blame] | 69 | DEPENDS clang c-index-test FileCheck not count | 
| Daniel Dunbar | ecac0a4 | 2009-09-17 19:55:53 +0000 | [diff] [blame] | 70 | COMMENT "Running Clang regression tests") | 
| Daniel Dunbar | 3967fca | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 71 |  | 
|  | 72 | add_custom_target(clang-c++tests | 
| Daniel Dunbar | a3b52d7 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 73 | COMMAND ${PYTHON_EXECUTABLE} | 
| Daniel Dunbar | 3967fca | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 74 | ${LLVM_SOURCE_DIR}/utils/lit/lit.py | 
| Daniel Dunbar | d3f630f | 2009-11-05 16:36:19 +0000 | [diff] [blame] | 75 | --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg | 
| Daniel Dunbar | 0669670 | 2009-11-07 23:53:32 +0000 | [diff] [blame] | 76 | --param build_config=${CMAKE_CFG_INTDIR} | 
| NAKAMURA Takumi | 78e3fdb | 2010-11-11 04:09:51 +0000 | [diff] [blame] | 77 | ${LIT_ARGS} | 
| Daniel Dunbar | 3967fca | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 78 | ${CMAKE_CURRENT_SOURCE_DIR}/../utils/C++Tests | 
| Daniel Dunbar | 328913c | 2010-07-29 22:57:17 +0000 | [diff] [blame] | 79 | DEPENDS clang c-index-test FileCheck not count | 
| Daniel Dunbar | 3967fca | 2009-09-22 10:07:55 +0000 | [diff] [blame] | 80 | COMMENT "Running Clang regression tests") | 
| NAKAMURA Takumi | c66906a | 2010-11-29 01:18:56 +0000 | [diff] [blame] | 81 |  | 
|  | 82 | add_custom_target(check-all | 
|  | 83 | COMMAND ${PYTHON_EXECUTABLE} | 
|  | 84 | ${LLVM_SOURCE_DIR}/utils/lit/lit.py | 
|  | 85 | --param build_config=${CMAKE_CFG_INTDIR} | 
|  | 86 | --param build_mode=${RUNTIME_BUILD_MODE} | 
|  | 87 | ${LIT_ARGS} | 
|  | 88 | ${LLVM_BINARY_DIR}/test | 
|  | 89 | ${CMAKE_CURRENT_BINARY_DIR} | 
|  | 90 | COMMENT "Running Clang and LLVM regression tests") | 
| Daniel Dunbar | a3b52d7 | 2009-11-03 07:25:53 +0000 | [diff] [blame] | 91 | endif() |