2009-06-06 08:21:31 +00:00
|
|
|
set(CLANG_TEST_DIRECTORIES
|
|
|
|
"Analysis"
|
2009-10-14 18:03:49 +00:00
|
|
|
"CodeCompletion"
|
2009-06-06 08:21:31 +00:00
|
|
|
"CodeGen"
|
|
|
|
"CodeGenCXX"
|
|
|
|
"CodeGenObjC"
|
|
|
|
"Coverage"
|
2009-06-22 08:08:35 +00:00
|
|
|
"CXX"
|
2009-06-06 08:21:31 +00:00
|
|
|
"Driver"
|
|
|
|
"FixIt"
|
|
|
|
"Frontend"
|
2009-07-04 13:58:54 +00:00
|
|
|
"Index"
|
2009-06-06 08:21:31 +00:00
|
|
|
"Lexer"
|
|
|
|
"Misc"
|
|
|
|
"PCH"
|
|
|
|
"Parser"
|
|
|
|
"Preprocessor"
|
|
|
|
"Rewriter"
|
|
|
|
"Sema"
|
|
|
|
"SemaCXX"
|
|
|
|
"SemaObjC"
|
|
|
|
"SemaObjCXX"
|
|
|
|
"SemaTemplate")
|
|
|
|
|
2009-11-18 14:59:57 +00:00
|
|
|
set(LLVM_SOURCE_DIR "${LLVM_MAIN_SRC_DIR}")
|
|
|
|
set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}")
|
|
|
|
set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
|
|
|
|
set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib/%(build_config)s")
|
|
|
|
set(CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
|
|
|
|
set(CLANG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
|
|
|
|
|
2009-06-06 08:21:31 +00:00
|
|
|
include(FindPythonInterp)
|
|
|
|
if(PYTHONINTERP_FOUND)
|
2009-06-22 08:08:35 +00:00
|
|
|
set(CLANG_TEST_EXTRA_ARGS)
|
|
|
|
if (MSVC OR XCODE)
|
|
|
|
set(CLANG_TEST_EXTRA_ARGS "--no-progress-bar")
|
|
|
|
endif()
|
2009-06-06 08:21:31 +00:00
|
|
|
|
2009-12-01 11:08:04 +00:00
|
|
|
option(CLANG_TEST_USE_VG "Run Clang tests under Valgrind" OFF)
|
|
|
|
if(CLANG_TEST_USE_VG)
|
|
|
|
set(CLANG_TEST_EXTRA_ARGS ${CLANG_TEST_EXTRA_ARGS} "--vg")
|
|
|
|
endif ()
|
|
|
|
|
2009-10-14 18:03:49 +00:00
|
|
|
foreach(testdir ${CLANG_TEST_DIRECTORIES})
|
2009-11-04 15:04:32 +00:00
|
|
|
add_custom_target(clang-test-${testdir}
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE}
|
2009-10-14 18:03:49 +00:00
|
|
|
${LLVM_SOURCE_DIR}/utils/lit/lit.py
|
2009-11-05 17:18:09 +00:00
|
|
|
--param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
2009-11-18 14:59:57 +00:00
|
|
|
--param build_config=${CMAKE_CFG_INTDIR}
|
2009-10-14 18:03:49 +00:00
|
|
|
-sv ${CLANG_TEST_EXTRA_ARGS}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/${testdir}
|
2009-12-15 18:49:47 +00:00
|
|
|
DEPENDS clang index-test c-index-test
|
2009-10-14 18:03:49 +00:00
|
|
|
COMMENT "Running Clang regression tests in ${testdir}")
|
2009-06-06 08:21:31 +00:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_target(clang-test
|
2009-11-04 15:04:32 +00:00
|
|
|
COMMAND ${PYTHON_EXECUTABLE}
|
2009-10-14 18:03:49 +00:00
|
|
|
${LLVM_SOURCE_DIR}/utils/lit/lit.py
|
2009-11-05 17:18:09 +00:00
|
|
|
--param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
2009-11-18 14:59:57 +00:00
|
|
|
--param build_config=${CMAKE_CFG_INTDIR}
|
2009-10-14 18:03:49 +00:00
|
|
|
-sv ${CLANG_TEST_EXTRA_ARGS}
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
2009-12-15 18:49:47 +00:00
|
|
|
DEPENDS clang index-test c-index-test
|
2009-10-14 18:03:49 +00:00
|
|
|
COMMENT "Running Clang regression tests")
|
|
|
|
|
|
|
|
add_custom_target(clang-c++tests
|
2009-11-04 15:04:32 +00:00
|
|
|
COMMAND ${PYTHON_EXECUTABLE}
|
2009-10-14 18:03:49 +00:00
|
|
|
${LLVM_SOURCE_DIR}/utils/lit/lit.py
|
2009-11-05 17:18:09 +00:00
|
|
|
--param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
|
2009-11-18 14:59:57 +00:00
|
|
|
--param build_config=${CMAKE_CFG_INTDIR}
|
2009-10-14 18:03:49 +00:00
|
|
|
-sv ${CLANG_TEST_EXTRA_ARGS}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../utils/C++Tests
|
2009-12-15 18:49:47 +00:00
|
|
|
DEPENDS clang index-test c-index-test
|
2009-10-14 18:03:49 +00:00
|
|
|
COMMENT "Running Clang regression tests")
|
2009-11-04 15:04:32 +00:00
|
|
|
endif()
|