[lldb/Test] Don't use the env to pass around configuration variables (NFC)

Don't use the environment to pass values to the builder that are present
in the dotest configuration module. A subsequent patch will pass the
remaining values through the configuration instead of the environment.
This commit is contained in:
Jonas Devlieghere 2020-06-02 16:08:11 -07:00
parent 232d348c6e
commit 5138a91ef4
2 changed files with 9 additions and 13 deletions

View File

@ -462,8 +462,6 @@ def parseOptionsAndInitTestdirs():
configuration.clang_module_cache_dir = os.path.join(
configuration.test_build_dir, 'module-cache-clang')
os.environ['CLANG_MODULE_CACHE_DIR'] = configuration.clang_module_cache_dir
if args.lldb_libs_dir:
configuration.lldb_libs_dir = args.lldb_libs_dir
@ -522,7 +520,6 @@ def setupSysPath():
os.environ["LLDB_TEST_SRC"] = lldbsuite.lldb_test_root
# Set up the root build directory.
builddir = configuration.test_build_dir
if not configuration.test_build_dir:
raise Exception("test_build_dir is not set")
os.environ["LLDB_BUILD"] = os.path.abspath(configuration.test_build_dir)
@ -1096,8 +1093,6 @@ def run_suite():
print("compiler=%s" % configuration.compiler)
# Iterating over all possible architecture and compiler combinations.
os.environ["ARCH"] = configuration.arch
os.environ["CC"] = configuration.compiler
configString = "arch=%s compiler=%s" % (configuration.arch,
configuration.compiler)

View File

@ -21,17 +21,18 @@ import sys
# Our imports
import lldbsuite.test.lldbtest as lldbtest
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test import configuration
from lldbsuite.test_event import build_exception
def getArchitecture():
"""Returns the architecture in effect the test suite is running with."""
return os.environ["ARCH"] if "ARCH" in os.environ else ""
return configuration.arch if configuration.arch else ""
def getCompiler():
"""Returns the compiler in effect the test suite is running with."""
compiler = os.environ.get("CC", "clang")
compiler = configuration.compiler if configuration.compiler else "clang"
compiler = lldbutil.which(compiler)
return os.path.realpath(compiler)
@ -86,8 +87,8 @@ def getArchSpec(architecture):
used for the make system.
"""
arch = architecture if architecture else None
if not arch and "ARCH" in os.environ:
arch = os.environ["ARCH"]
if not arch and configuration.arch:
arch = configuration.arch
return ("ARCH=" + arch) if arch else ""
@ -98,8 +99,8 @@ def getCCSpec(compiler):
used for the make system.
"""
cc = compiler if compiler else None
if not cc and "CC" in os.environ:
cc = os.environ["CC"]
if not cc and configuration.compiler:
cc = configuration.compiler
if cc:
return "CC=\"%s\"" % cc
else:
@ -128,9 +129,9 @@ def getModuleCacheSpec():
Helper function to return the key-value string to specify the clang
module cache used for the make system.
"""
if "CLANG_MODULE_CACHE_DIR" in os.environ:
if configuration.clang_module_cache_dir:
return "CLANG_MODULE_CACHE_DIR={}".format(
os.environ["CLANG_MODULE_CACHE_DIR"])
configuration.clang_module_cache_dir)
return "";
def getCmdLine(d):