CMake/lit: Add llvm_{unit_,}site_config parameters, and always pass them when running...
authorDaniel Dunbar <daniel@zuster.org>
Tue, 8 Dec 2009 19:47:36 +0000 (19:47 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 8 Dec 2009 19:47:36 +0000 (19:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90869 91177308-0d34-0410-b5e6-96231b3b80d8

test/CMakeLists.txt
test/Unit/lit.cfg
test/lit.cfg

index d7037ab44c3f7831790a624a719350cf0209eba2..5ad48eff4e7dd6cf7ec2943ed85d275d9c28ce82 100644 (file)
@@ -31,6 +31,8 @@ if(PYTHONINTERP_FOUND)
                 ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
     COMMAND ${PYTHON_EXECUTABLE}
                 ${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
                 -sv
                 ${CMAKE_CURRENT_BINARY_DIR}
                 DEPENDS
index 8321593cf715c76faa6761545bcb0db9b1b05c65..34372bb6cbe9381c519c0f96f9ccdb512b75f8a8 100644 (file)
@@ -32,6 +32,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 'llvm_unit_site_config' user parameter, and use that if available.
+    site_cfg = lit.params.get('llvm_unit_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'.
     #
index 193979232772ba88460818ce68ddf0fbd915984a..246f2701ce693c017788d7a77272c7dd3ed530d8 100644 (file)
@@ -58,6 +58,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 'llvm_site_config' user parameter, and use that if available.
+    site_cfg = lit.params.get('llvm_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'.
     #