]> granicus.if.org Git - clang/commitdiff
Add clang_site_config user variable, so that extra tests (e.g., utils/C++Syntax)
authorDaniel Dunbar <daniel@zuster.org>
Thu, 5 Nov 2009 16:36:19 +0000 (16:36 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 5 Nov 2009 16:36:19 +0000 (16:36 +0000)
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

test/CMakeLists.txt
test/Makefile
test/lit.cfg

index a83a1993c8f043d29d4e0a2931562b8fcb084f13..8b3c738ed78b9571f07d6fe0c68ce0302451d1a7 100644 (file)
@@ -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
index a67fcbdc80f91cd7d7832494368335a75c54f18d..b7cb38af8af057e3709774d8c181f9130c8d458c 100644 (file)
@@ -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:
 
index 60d8df057730f406cfaaa946b9fa651326055df2..9b274fed30b50ca0e0a546d0b7849bd3d5783964 100644 (file)
@@ -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'.
     #