tests: Propogate LLVM_SRC_ROOT and PYTHON_EXECUTABLE environment variables to tests.
authorDaniel Dunbar <daniel@zuster.org>
Sat, 12 Jun 2010 16:21:19 +0000 (16:21 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sat, 12 Jun 2010 16:21:19 +0000 (16:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105890 91177308-0d34-0410-b5e6-96231b3b80d8

test/CMakeLists.txt
test/lit.cfg
test/lit.site.cfg.in

index ab060c91a582608456c37aafabd357d3d195751e..433af900dd2b4bc4ab5b64fc9dbfed7153b53fcc 100644 (file)
@@ -35,6 +35,7 @@ if(PYTHONINTERP_FOUND)
                 -e "s#\@LLVM_BINARY_DIR\@#${LLVM_BINARY_DIR}#"
                 -e "s#\@LLVM_TOOLS_DIR\@#${LLVM_TOOLS_BINARY_DIR}/${CMAKE_CFG_INTDIR}#"
                 -e "s#\@LLVMGCCDIR\@##"
+                -e "s#\@PYTHON_EXECUTABLE\@#${PYTHON_EXECUTABLE}#"
                 ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in >
                 ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
     COMMAND sed -e "s#\@LLVM_SOURCE_DIR\@#${LLVM_MAIN_SRC_DIR}#"
index fd3120a29fe984bb954e7f381dab5aee3747a569..65e0dc7ea0d63e27b71ba50f8d648fcfb49a1b40 100644 (file)
@@ -48,6 +48,13 @@ if llvm_obj_root is not None:
 # Propogate 'HOME' through the environment.
 config.environment['HOME'] = os.environ['HOME']
 
+# Propogate LLVM_SRC_ROOT into the environment.
+config.environment['LLVM_SRC_ROOT'] = config.llvm_src_root
+
+# Propogate PYTHON_EXEUTABLE into the environment
+config.environment['PYTHON_EXECUTABLE'] = getattr(config, 'python_executable',
+                                                  '')
+
 ###
 
 import os
index 88699e3e76f78eaf9842e5253fe58a8d2ae51f37..79b2c602a07c35da83f4fbcf28a6ef56e2bfc402 100644 (file)
@@ -4,6 +4,7 @@ config.llvm_src_root = "@LLVM_SOURCE_DIR@"
 config.llvm_obj_root = "@LLVM_BINARY_DIR@"
 config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
 config.llvmgcc_dir = "@LLVMGCCDIR@"
+config.python_executable = "@PYTHON_EXECUTABLE@"
 
 # Let the main config do the real work.
 lit.load_config(config, "@LLVM_SOURCE_DIR@/test/lit.cfg")