[cfe-commits] r86139 - in /cfe/trunk/test: CMakeLists.txt Makefile lit.cfg

Daniel Dunbar daniel at zuster.org
Thu Nov 5 08:36:19 PST 2009


Author: ddunbar
Date: Thu Nov  5 10:36:19 2009
New Revision: 86139

URL: http://llvm.org/viewvc/llvm-project?rev=86139&view=rev
Log:
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).

Modified:
    cfe/trunk/test/CMakeLists.txt
    cfe/trunk/test/Makefile
    cfe/trunk/test/lit.cfg

Modified: cfe/trunk/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CMakeLists.txt?rev=86139&r1=86138&r2=86139&view=diff

==============================================================================
--- cfe/trunk/test/CMakeLists.txt (original)
+++ cfe/trunk/test/CMakeLists.txt Thu Nov  5 10:36:19 2009
@@ -45,6 +45,7 @@
                   ${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 @@
                 ${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 @@
                 ${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

Modified: cfe/trunk/test/Makefile
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Makefile?rev=86139&r1=86138&r2=86139&view=diff

==============================================================================
--- cfe/trunk/test/Makefile (original)
+++ cfe/trunk/test/Makefile Thu Nov  5 10:36:19 2009
@@ -22,16 +22,17 @@
 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:
 

Modified: cfe/trunk/test/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/lit.cfg?rev=86139&r1=86138&r2=86139&view=diff

==============================================================================
--- cfe/trunk/test/lit.cfg (original)
+++ cfe/trunk/test/lit.cfg Thu Nov  5 10:36:19 2009
@@ -55,6 +55,12 @@
     # 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'.
     #





More information about the cfe-commits mailing list