Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 1 | set(CLANG_TEST_DIRECTORIES |
| 2 | "Analysis" |
| 3 | "CodeGen" |
| 4 | "CodeGenCXX" |
| 5 | "CodeGenObjC" |
| 6 | "Coverage" |
Douglas Gregor | ebfc180 | 2009-06-16 20:13:51 +0000 | [diff] [blame] | 7 | "CXX" |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 8 | "Driver" |
| 9 | "FixIt" |
| 10 | "Frontend" |
| 11 | "Lexer" |
| 12 | "Misc" |
| 13 | "PCH" |
| 14 | "Parser" |
| 15 | "Preprocessor" |
| 16 | "Rewriter" |
| 17 | "Sema" |
| 18 | "SemaCXX" |
| 19 | "SemaObjC" |
| 20 | "SemaObjCXX" |
| 21 | "SemaTemplate") |
Douglas Gregor | eb357b6 | 2009-06-05 16:00:31 +0000 | [diff] [blame] | 22 | |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 23 | include(FindPythonInterp) |
| 24 | if(PYTHONINTERP_FOUND) |
| 25 | get_target_property(LLVM_TOOLS_PATH clang RUNTIME_OUTPUT_DIRECTORY) |
| 26 | set(TESTING_EXTRA_PATHS |
| 27 | "${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}:${LLVM_SOURCE_DIR}/test/Scripts") |
Douglas Gregor | ebfc180 | 2009-06-16 20:13:51 +0000 | [diff] [blame] | 28 | set(CLANG_TEST_EXTRA_ARGS) |
| 29 | if (MSVC OR XCODE) |
| 30 | set(CLANG_TEST_EXTRA_ARGS "--no-progress-bar") |
| 31 | endif() |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 32 | set(all_testdirs) |
Douglas Gregor | ebfc180 | 2009-06-16 20:13:51 +0000 | [diff] [blame] | 33 | foreach(testdir ${CLANG_TEST_DIRECTORIES}) |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 34 | add_custom_target(clang-test-${testdir} |
| 35 | ${PYTHON_EXECUTABLE} |
| 36 | ${LLVM_SOURCE_DIR}/tools/clang/utils/test/MultiTestRunner.py |
Douglas Gregor | ebfc180 | 2009-06-16 20:13:51 +0000 | [diff] [blame] | 37 | "--path=${TESTING_EXTRA_PATHS}" |
| 38 | -s ${CLANG_TEST_EXTRA_ARGS} |
| 39 | ${CMAKE_CURRENT_SOURCE_DIR}/${testdir}/ |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 40 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
| 41 | COMMENT "Running Clang regression tests in ${testdir}") |
| 42 | |
| 43 | list(APPEND all_testdirs ${CMAKE_CURRENT_SOURCE_DIR}/${testdir}/) |
Douglas Gregor | f5dba38 | 2009-06-05 16:26:18 +0000 | [diff] [blame] | 44 | endforeach() |
Douglas Gregor | eb357b6 | 2009-06-05 16:00:31 +0000 | [diff] [blame] | 45 | |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 46 | add_custom_target(clang-test |
| 47 | ${PYTHON_EXECUTABLE} |
| 48 | ${LLVM_SOURCE_DIR}/tools/clang/utils/test/MultiTestRunner.py |
| 49 | "--path=${TESTING_EXTRA_PATHS}" |
Douglas Gregor | ebfc180 | 2009-06-16 20:13:51 +0000 | [diff] [blame] | 50 | -s ${CLANG_TEST_EXTRA_ARGS} |
Douglas Gregor | 7986519 | 2009-06-05 23:57:17 +0000 | [diff] [blame] | 51 | ${all_testdirs} |
| 52 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
| 53 | DEPENDS clang clang-cc |
| 54 | COMMENT "Running Clang regression tests") |
| 55 | endif() |