summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-09-22 07:38:44 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-09-22 07:38:44 +0000
commit28830b39b4bd2fec7ba937b49d1389ac0b56c322 (patch)
treebf05b0ff91846cb9a9a4d47212375c39b46300cd /llvm/test/CMakeLists.txt
parentGenerate lit.site.cfg from a .in file, as clang does. (diff)
downloadllvm-project-28830b39b4bd2fec7ba937b49d1389ac0b56c322.tar.gz
llvm-project-28830b39b4bd2fec7ba937b49d1389ac0b56c322.tar.bz2
llvm-project-28830b39b4bd2fec7ba937b49d1389ac0b56c322.zip
Initial support for running LLVM tests from cmake.
llvm-svn: 82534
Diffstat (limited to 'llvm/test/CMakeLists.txt')
-rw-r--r--llvm/test/CMakeLists.txt31
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/test/CMakeLists.txt b/llvm/test/CMakeLists.txt
new file mode 100644
index 000000000000..627b57d85634
--- /dev/null
+++ b/llvm/test/CMakeLists.txt
@@ -0,0 +1,31 @@
+include(GetTargetTriple)
+get_target_triple(target)
+
+foreach(c ${LLVM_TARGETS_TO_BUILD})
+ set(TARGETS_BUILT "${TARGETS_BUILT} ${c}")
+endforeach(c)
+set(TARGETS_TO_BUILD ${TARGETS_BUILT})
+
+include(FindPythonInterp)
+if(PYTHONINTERP_FOUND)
+ get_target_property(LLVM_TOOLS_PATH llvm-config RUNTIME_OUTPUT_DIRECTORY)
+
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/site.exp.in
+ ${CMAKE_CURRENT_BINARY_DIR}/site.exp)
+
+ add_custom_target(llvm-test
+ COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#"
+ -e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#"
+ -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_PATH}/${CMAKE_CFG_INTDIR}#"
+ -e "s#\@LLVMGCC_DIR\@##"
+ ${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
+ -sv
+ ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS
+ COMMENT "Running LLVM regression tests")
+
+endif()