1 set(CLANG_TEST_DIRECTORIES
29 set(LLVM_SOURCE_DIR "${LLVM_MAIN_SRC_DIR}")
30 set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}")
31 set(LLVM_BUILD_MODE "%(build_mode)s")
32 set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
33 set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib/%(build_config)s")
34 set(CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
35 set(CLANG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
40 endif(BUILD_SHARED_LIBS)
43 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
44 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
47 ${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
48 ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
51 include(FindPythonInterp)
52 if(PYTHONINTERP_FOUND)
53 if( LLVM_MAIN_SRC_DIR )
54 set(LIT "${LLVM_SOURCE_DIR}/utils/lit/lit.py")
56 set(LIT "${PATH_TO_LLVM_BUILD}/bin/${CMAKE_CFG_INTDIR}/llvm-lit")
59 if( PATH_TO_LLVM_BUILD )
60 set(CLANG_TEST_EXTRA_ARGS "--path=${CLANG_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}")
63 option(CLANG_TEST_USE_VG "Run Clang tests under Valgrind" OFF)
65 set(CLANG_TEST_EXTRA_ARGS ${CLANG_TEST_EXTRA_ARGS} "--vg")
68 set(LIT_ARGS "${CLANG_TEST_EXTRA_ARGS} ${LLVM_LIT_ARGS}")
69 separate_arguments(LIT_ARGS)
71 add_custom_target(clang-test.deps)
73 foreach(testdir ${CLANG_TEST_DIRECTORIES})
74 add_custom_target(clang-test-${testdir}
75 COMMAND ${PYTHON_EXECUTABLE}
77 --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
78 --param build_config=${CMAKE_CFG_INTDIR}
80 ${CMAKE_CURRENT_BINARY_DIR}/${testdir}
81 DEPENDS clang c-index-test FileCheck not count
82 COMMENT "Running Clang regression tests in ${testdir}")
85 add_custom_target(clang-test
86 COMMAND ${PYTHON_EXECUTABLE}
88 --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
89 --param clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
90 --param build_config=${CMAKE_CFG_INTDIR}
91 --param build_mode=${RUNTIME_BUILD_MODE}
93 ${CMAKE_CURRENT_BINARY_DIR}
94 COMMENT "Running Clang regression tests")
96 add_custom_target(clang-c++tests
97 COMMAND ${PYTHON_EXECUTABLE}
99 --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
100 --param build_config=${CMAKE_CFG_INTDIR}
102 ${CMAKE_CURRENT_SOURCE_DIR}/../utils/C++Tests
103 DEPENDS clang c-index-test FileCheck not count
104 COMMENT "Running Clang regression tests")
106 if( NOT CLANG_BUILT_STANDALONE )
107 add_custom_target(check-all
108 COMMAND ${PYTHON_EXECUTABLE}
110 --param build_config=${CMAKE_CFG_INTDIR}
111 --param build_mode=${RUNTIME_BUILD_MODE}
113 ${LLVM_BINARY_DIR}/test
114 ${CMAKE_CURRENT_BINARY_DIR}
115 COMMENT "Running Clang and LLVM regression tests")
116 add_dependencies(check-all check.deps clang-test.deps)
117 add_dependencies(clang-test.deps
125 add_dependencies(clang-test clang-test.deps)
126 add_dependencies(clang-test.deps
127 clang clang-headers c-index-test