blob: 204d26a7132d94e9d34cebd89f4e034cfa2e789d [file] [log] [blame]
Douglas Gregor79865192009-06-05 23:57:17 +00001set(CLANG_TEST_DIRECTORIES
2 "Analysis"
3 "CodeGen"
4 "CodeGenCXX"
5 "CodeGenObjC"
6 "Coverage"
Douglas Gregorebfc1802009-06-16 20:13:51 +00007 "CXX"
Douglas Gregor79865192009-06-05 23:57:17 +00008 "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 Gregoreb357b62009-06-05 16:00:31 +000022
Douglas Gregor79865192009-06-05 23:57:17 +000023include(FindPythonInterp)
24if(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 Gregorebfc1802009-06-16 20:13:51 +000028 set(CLANG_TEST_EXTRA_ARGS)
29 if (MSVC OR XCODE)
30 set(CLANG_TEST_EXTRA_ARGS "--no-progress-bar")
31 endif()
Douglas Gregor79865192009-06-05 23:57:17 +000032 set(all_testdirs)
Douglas Gregorebfc1802009-06-16 20:13:51 +000033 foreach(testdir ${CLANG_TEST_DIRECTORIES})
Douglas Gregor79865192009-06-05 23:57:17 +000034 add_custom_target(clang-test-${testdir}
35 ${PYTHON_EXECUTABLE}
36 ${LLVM_SOURCE_DIR}/tools/clang/utils/test/MultiTestRunner.py
Douglas Gregorebfc1802009-06-16 20:13:51 +000037 "--path=${TESTING_EXTRA_PATHS}"
38 -s ${CLANG_TEST_EXTRA_ARGS}
39 ${CMAKE_CURRENT_SOURCE_DIR}/${testdir}/
Douglas Gregor79865192009-06-05 23:57:17 +000040 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 Gregorf5dba382009-06-05 16:26:18 +000044 endforeach()
Douglas Gregoreb357b62009-06-05 16:00:31 +000045
Douglas Gregor79865192009-06-05 23:57:17 +000046 add_custom_target(clang-test
47 ${PYTHON_EXECUTABLE}
48 ${LLVM_SOURCE_DIR}/tools/clang/utils/test/MultiTestRunner.py
49 "--path=${TESTING_EXTRA_PATHS}"
Douglas Gregorebfc1802009-06-16 20:13:51 +000050 -s ${CLANG_TEST_EXTRA_ARGS}
Douglas Gregor79865192009-06-05 23:57:17 +000051 ${all_testdirs}
52 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
53 DEPENDS clang clang-cc
54 COMMENT "Running Clang regression tests")
55endif()