CursorVisitor: migrate handling of
[clang.git] / test / CMakeLists.txt
blob4d02d2b3eb663d5e9f8b117c90f1da26a4083da3
1 set(CLANG_TEST_DIRECTORIES
2   "Analysis"
3   "CodeCompletion"
4   "CodeGen"
5   "CodeGenCXX"
6   "CodeGenObjC"
7   "Coverage"
8   "CXX"
9   "Driver"
10   "FixIt"
11   "Frontend"
12   "Headers"
13   "Index"
14   "Lexer"
15   "Misc"
16   "PCH"
17   "Parser"
18   "Preprocessor"
19   "Rewriter"
20   "Sema"
21   "SemaCXX"
22   "SemaObjC"
23   "SemaObjCXX"
24   "SemaTemplate")
26 set(LLVM_SOURCE_DIR "${LLVM_MAIN_SRC_DIR}")
27 set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}")
28 set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
29 set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib/%(build_config)s")
30 set(CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
31 set(CLANG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
33 configure_file(
34   ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
35   ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
37 include(FindPythonInterp)
38 if(PYTHONINTERP_FOUND)
39   set(CLANG_TEST_EXTRA_ARGS)
41   option(CLANG_TEST_USE_VG "Run Clang tests under Valgrind" OFF)
42   if(CLANG_TEST_USE_VG)
43     set(CLANG_TEST_EXTRA_ARGS ${CLANG_TEST_EXTRA_ARGS} "--vg")
44   endif ()
46   set(LIT_ARGS "${CLANG_TEST_EXTRA_ARGS} ${LLVM_LIT_ARGS}")
47   separate_arguments(LIT_ARGS)
49   foreach(testdir ${CLANG_TEST_DIRECTORIES})
50     add_custom_target(clang-test-${testdir}
51       COMMAND ${PYTHON_EXECUTABLE}
52                   ${LLVM_SOURCE_DIR}/utils/lit/lit.py
53                   --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
54                   --param build_config=${CMAKE_CFG_INTDIR}
55                   ${LIT_ARGS}
56                   ${CMAKE_CURRENT_BINARY_DIR}/${testdir}
57                   DEPENDS clang c-index-test FileCheck not count
58                   COMMENT "Running Clang regression tests in ${testdir}")
59   endforeach()
61   add_custom_target(clang-test
62     COMMAND ${PYTHON_EXECUTABLE}
63                 ${LLVM_SOURCE_DIR}/utils/lit/lit.py
64                 --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
65                 --param build_config=${CMAKE_CFG_INTDIR}
66                 ${LIT_ARGS}
67                 ${CMAKE_CURRENT_BINARY_DIR}
68                 DEPENDS clang c-index-test FileCheck not count
69                 COMMENT "Running Clang regression tests")
71   add_custom_target(clang-c++tests
72     COMMAND ${PYTHON_EXECUTABLE}
73                 ${LLVM_SOURCE_DIR}/utils/lit/lit.py
74                 --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
75                 --param build_config=${CMAKE_CFG_INTDIR}
76                 ${LIT_ARGS}
77                 ${CMAKE_CURRENT_SOURCE_DIR}/../utils/C++Tests
78                 DEPENDS clang c-index-test FileCheck not count
79                 COMMENT "Running Clang regression tests")
80 endif()