summaryrefslogtreecommitdiffstats
path: root/test/CMakeLists.txt
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-09-17 19:55:53 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-09-17 19:55:53 +0000
commit7af18d359f6eff022a7a55335705b018a3c191d7 (patch)
treedbafdd212411851a8cd31fbe6235d08dc2bc9f0b /test/CMakeLists.txt
parentd85cef5a54074a5f647f45c2218675f7774a909d (diff)
Tweak clang testing.
- Move CMake to using the new test runner. - Switch Makefiles to use the lit.site.cfg.in template. - Remove explicit --path arguments, instead this gets written into the site configuration. This means running lit from the command line should use the exact same configuration as is used in 'make test', assuming it can find the site configuration file. You still need to run 'make test' (or the cmake build target equivalent) at least once. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82160 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CMakeLists.txt')
-rw-r--r--test/CMakeLists.txt55
1 files changed, 24 insertions, 31 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index e154c0c4d5..e6cd13cc2d 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -28,39 +28,32 @@ if(PYTHONINTERP_FOUND)
if (MSVC OR XCODE)
set(CLANG_TEST_EXTRA_ARGS "--no-progress-bar")
endif()
- set(all_testdirs)
- foreach(testdir ${CLANG_TEST_DIRECTORIES})
- add_custom_target(clang-test-${testdir}
- ${PYTHON_EXECUTABLE}
- ${LLVM_SOURCE_DIR}/tools/clang/utils/test/MultiTestRunner.py
- "--root=${LLVM_SOURCE_DIR}/tools/clang/test"
- "--path=${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}"
- "--path=${LLVM_SOURCE_DIR}/test/Scripts"
- -s ${CLANG_TEST_EXTRA_ARGS}
- --clang=${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}/clang
- --clang-cc=${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}/clang-cc
- ${CMAKE_CURRENT_SOURCE_DIR}/${testdir}/
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMENT "Running Clang regression tests in ${testdir}")
- list(APPEND all_testdirs ${CMAKE_CURRENT_SOURCE_DIR}/${testdir}/)
+ foreach(testdir ${CLANG_TEST_DIRECTORIES})
+ add_custom_target(clang-test-${testdir}
+ COMMAND sed -e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#"
+ -e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#"
+ -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}#"
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in >
+ ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+ COMMAND ${PYTHON_EXECUTABLE}
+ ${LLVM_SOURCE_DIR}/utils/lit/lit.py
+ -s ${CLANG_TEST_EXTRA_ARGS}
+ ${CMAKE_CURRENT_BINARY_DIR}/${testdir}
+ DEPENDS clang clang-cc index-test
+ COMMENT "Running Clang regression tests in ${testdir}")
endforeach()
add_custom_target(clang-test
- ${PYTHON_EXECUTABLE}
- ${LLVM_SOURCE_DIR}/tools/clang/utils/test/MultiTestRunner.py
- "--root=${LLVM_SOURCE_DIR}/tools/clang/test"
- "--path=${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}"
- "--path=${LLVM_SOURCE_DIR}/test/Scripts"
- -s ${CLANG_TEST_EXTRA_ARGS}
- --clang=${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}/clang
- --clang-cc=${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}/clang-cc
- ${all_testdirs}
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- DEPENDS clang clang-cc index-test
- COMMENT "Running Clang regression tests")
+ COMMAND sed -e "s#\@CLANG_SOURCE_DIR\@#${CMAKE_CURRENT_SOURCE_DIR}/..#"
+ -e "s#\@CLANG_BINARY_DIR\@#${CMAKE_CURRENT_BINARY_DIR}/..#"
+ -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}#"
+ ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in >
+ ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
+ COMMAND ${PYTHON_EXECUTABLE}
+ ${LLVM_SOURCE_DIR}/utils/lit/lit.py
+ -s ${CLANG_TEST_EXTRA_ARGS}
+ ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS clang clang-cc index-test
+ COMMENT "Running Clang regression tests")
endif()
-
-# Produce LIT site configuration file.
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
- ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)