1 set(CLANG_TEST_DIRECTORIES
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}/..")
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)
43 set(CLANG_TEST_EXTRA_ARGS ${CLANG_TEST_EXTRA_ARGS} "--vg")
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}
56 ${CMAKE_CURRENT_BINARY_DIR}/${testdir}
57 DEPENDS clang c-index-test FileCheck not count
58 COMMENT "Running Clang regression tests in ${testdir}")
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}
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}
77 ${CMAKE_CURRENT_SOURCE_DIR}/../utils/C++Tests
78 DEPENDS clang c-index-test FileCheck not count
79 COMMENT "Running Clang regression tests")