aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-05 16:36:19 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-05 16:36:19 +0000
commitb258d8f961212490800f96b97275dd6961ca1cc0 (patch)
tree7631d7da16d256b57999f9d32f5cceeddd369f41
parent923d56d436f750bc1f29db50e641078725558a1b (diff)
Add clang_site_config user variable, so that extra tests (e.g., utils/C++Syntax)
can always find the main clang site config (when invoked via CMake/Makefiles, at least). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86139 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CMakeLists.txt3
-rw-r--r--test/Makefile9
-rw-r--r--test/lit.cfg6
3 files changed, 14 insertions, 4 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index a83a1993c8..8b3c738ed7 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -45,6 +45,7 @@ if(PYTHONINTERP_FOUND)
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
COMMAND ${PYTHON_EXECUTABLE}
${LLVM_SOURCE_DIR}/utils/lit/lit.py
+ --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
-sv ${CLANG_TEST_EXTRA_ARGS}
${CMAKE_CURRENT_BINARY_DIR}/${testdir}
DEPENDS clang clang-cc index-test c-index-test
@@ -63,6 +64,7 @@ if(PYTHONINTERP_FOUND)
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
COMMAND ${PYTHON_EXECUTABLE}
${LLVM_SOURCE_DIR}/utils/lit/lit.py
+ --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
-sv ${CLANG_TEST_EXTRA_ARGS}
${CMAKE_CURRENT_BINARY_DIR}
DEPENDS clang clang-cc index-test c-index-test
@@ -80,6 +82,7 @@ if(PYTHONINTERP_FOUND)
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
COMMAND ${PYTHON_EXECUTABLE}
${LLVM_SOURCE_DIR}/utils/lit/lit.py
+ --param clang_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
-sv ${CLANG_TEST_EXTRA_ARGS}
${CMAKE_CURRENT_SOURCE_DIR}/../utils/C++Tests
DEPENDS clang clang-cc index-test c-index-test
diff --git a/test/Makefile b/test/Makefile
index a67fcbdc80..b7cb38af8a 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -22,16 +22,17 @@ TESTARGS = -s
endif
endif
+# Make sure any extra test suites can find the main site config.
+LIT_ARGS := --param clang_site_config=$(PROJ_OBJ_DIR)/lit.site.cfg
+
ifdef VG
- VGARG="--vg"
-else
- VGARG=
+ LIT_ARGS += "--vg"
endif
all:: lit.site.cfg
@ echo '--- Running clang tests for $(TARGET_TRIPLE) ---'
@ $(PYTHON) $(LLVM_SRC_ROOT)/utils/lit/lit.py \
- $(TESTARGS) $(TESTDIRS) $(VGARG)
+ $(LIT_ARGS) $(TESTARGS) $(TESTDIRS)
FORCE:
diff --git a/test/lit.cfg b/test/lit.cfg
index 60d8df0577..9b274fed30 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -55,6 +55,12 @@ if config.test_exec_root is None:
# configuration hasn't been created by the build system, or we are in an
# out-of-tree build situation).
+ # Check for 'clang_site_config' user parameter, and use that if available.
+ site_cfg = lit.params.get('clang_site_config', None)
+ if site_cfg and os.path.exists(site_cfg):
+ lit.load_config(config, site_cfg)
+ raise SystemExit
+
# Try to detect the situation where we are using an out-of-tree build by
# looking for 'llvm-config'.
#