aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2010-11-27 13:10:11 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2010-11-27 13:10:11 +0000
commitd420e7b76cefb350a9cb89f1fb417f3f42636e30 (patch)
tree6b6f5b3a226ae5be86bfe36cc848a3091e3e8483 /test
parent3946e3b4764ab0146693aad53687d33b7ae6bb78 (diff)
downloadexternal_llvm-d420e7b76cefb350a9cb89f1fb417f3f42636e30.zip
external_llvm-d420e7b76cefb350a9cb89f1fb417f3f42636e30.tar.gz
external_llvm-d420e7b76cefb350a9cb89f1fb417f3f42636e30.tar.bz2
CMake: lit(check.vcproj) can run with multiple configurations on Visual Studio.
Unittests need LLVM_BUILD_MODE to pick up each test. Confirmed on CentOS5, Mingw, MSYS, and with possible configurations on VS8 and VS10. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120212 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt16
-rw-r--r--test/Unit/lit.site.cfg.in9
-rw-r--r--test/lit.site.cfg.in8
3 files changed, 23 insertions, 10 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 5a8678b..0d622fa 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -50,20 +50,14 @@ if(PYTHONINTERP_FOUND)
MAKE_DIRECTORY(${CMAKE_CURRENT_BINARY_DIR}/Unit)
+ # Configuration-time: See Unit/lit.site.cfg.in
+ set(LLVM_BUILD_MODE "%(build_mode)s")
+
set(LLVM_SOURCE_DIR ${LLVM_MAIN_SRC_DIR})
set(LLVM_BINARY_DIR ${LLVM_BINARY_DIR})
- set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
+ set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
set(LLVMGCCDIR "")
set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
- if (CMAKE_CONFIGURATION_TYPES)
- # FIXME: We have no idea. It could be any of them... So just output all of
- # them.
- set(LLVM_BUILD_MODE "${CMAKE_CONFIGURATION_TYPES}")
- elseif (CMAKE_BUILD_TYPE)
- set(LLVM_BUILD_MODE "${CMAKE_BUILD_TYPE}")
- else()
- set(LLVM_BUILD_MODE "None")
- endif()
set(ENABLE_SHARED ${LLVM_SHARED_LIBS_ENABLED})
set(SHLIBPATH_VAR ${SHLIBPATH_VAR})
@@ -81,6 +75,8 @@ if(PYTHONINTERP_FOUND)
${LLVM_SOURCE_DIR}/utils/lit/lit.py
--param llvm_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
--param llvm_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
+ --param build_config=${CMAKE_CFG_INTDIR}
+ --param build_mode=${RUNTIME_BUILD_MODE}
${LIT_ARGS}
${CMAKE_CURRENT_BINARY_DIR}
DEPENDS
diff --git a/test/Unit/lit.site.cfg.in b/test/Unit/lit.site.cfg.in
index 51b5bc4..75932a4 100644
--- a/test/Unit/lit.site.cfg.in
+++ b/test/Unit/lit.site.cfg.in
@@ -8,5 +8,14 @@ config.llvm_build_mode = "@LLVM_BUILD_MODE@"
config.enable_shared = @ENABLE_SHARED@
config.shlibpath_var = "@SHLIBPATH_VAR@"
+# Support substitution of the tools_dir and build_mode with user parameters.
+# This is used when we can't determine the tool dir at configuration time.
+try:
+ config.llvm_tools_dir = config.llvm_tools_dir % lit.params
+ config.llvm_build_mode = config.llvm_build_mode % lit.params
+except KeyError,e:
+ key, = e.args
+ lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
+
# Let the main config do the real work.
lit.load_config(config, "@LLVM_SOURCE_DIR@/test/Unit/lit.cfg")
diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in
index 79b2c60..56b0a82 100644
--- a/test/lit.site.cfg.in
+++ b/test/lit.site.cfg.in
@@ -6,5 +6,13 @@ config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.llvmgcc_dir = "@LLVMGCCDIR@"
config.python_executable = "@PYTHON_EXECUTABLE@"
+# Support substitution of the tools_dir with user parameters. This is
+# used when we can't determine the tool dir at configuration time.
+try:
+ config.llvm_tools_dir = config.llvm_tools_dir % lit.params
+except KeyError,e:
+ key, = e.args
+ lit.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
+
# Let the main config do the real work.
lit.load_config(config, "@LLVM_SOURCE_DIR@/test/lit.cfg")