summaryrefslogtreecommitdiffstats
path: root/lldb/test
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/test')
-rw-r--r--lldb/test/API/lit.cfg14
-rw-r--r--lldb/test/API/lit.site.cfg.in5
-rw-r--r--lldb/test/CMakeLists.txt8
-rw-r--r--lldb/test/Shell/lit.cfg.py6
-rw-r--r--lldb/test/Shell/lit.site.cfg.py.in6
5 files changed, 28 insertions, 11 deletions
diff --git a/lldb/test/API/lit.cfg b/lldb/test/API/lit.cfg
index bb9e3aaaaa4..26286ed5c50 100644
--- a/lldb/test/API/lit.cfg
+++ b/lldb/test/API/lit.cfg
@@ -5,6 +5,7 @@
import os
import platform
import shlex
+import shutil
import lit.formats
@@ -52,6 +53,14 @@ if config.shared_libs:
lit_config.warning("unable to inject shared library path on '{}'".format(
platform.system()))
+# Clean the module caches in the test build directory. This is necessary in an
+# incremental build whenever clang changes underneath, so doing it once per
+# lit.py invocation is close enough.
+for cachedir in [config.clang_module_cache, config.lldb_module_cache]:
+ if os.path.isdir(cachedir):
+ print("Deleting module cache at %s."%cachedir)
+ shutil.rmtree(cachedir)
+
# Build dotest command.
dotest_cmd = [config.dotest_path]
dotest_cmd.extend(config.dotest_args_str.split(';'))
@@ -70,7 +79,10 @@ if config.lldb_build_directory:
dotest_cmd += ['--build-dir', config.lldb_build_directory]
if config.lldb_module_cache:
- dotest_cmd += ['--module-cache-dir', config.lldb_module_cache]
+ dotest_cmd += ['--lldb-module-cache-dir', config.lldb_module_cache]
+
+if config.clang_module_cache:
+ dotest_cmd += ['--clang-module-cache-dir', config.clang_module_cache]
# Load LLDB test format.
sys.path.append(os.path.join(config.lldb_src_root, "test", "API"))
diff --git a/lldb/test/API/lit.site.cfg.in b/lldb/test/API/lit.site.cfg.in
index 883bc403300..2f2956c002b 100644
--- a/lldb/test/API/lit.site.cfg.in
+++ b/lldb/test/API/lit.site.cfg.in
@@ -17,13 +17,14 @@ config.shared_libs = @LLVM_ENABLE_SHARED_LIBS@
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
config.target_triple = "@TARGET_TRIPLE@"
config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
-config.lldb_module_cache = "@LLDB_TEST_MODULE_CACHE_LLDB@"
-config.clang_module_cache = "@LLDB_TEST_MODULE_CACHE_CLANG@"
config.python_executable = "@PYTHON_EXECUTABLE@"
config.dotest_path = "@LLDB_SOURCE_DIR@/test/API/dotest.py"
config.dotest_args_str = "@LLDB_DOTEST_ARGS@"
config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
config.dotest_lit_args_str = None
+# The API tests use their own module caches.
+config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-api")
+config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", "lldb-api")
# Additional dotest arguments can be passed to lit by providing a
# semicolon-separates list: --param dotest-args="arg;arg".
diff --git a/lldb/test/CMakeLists.txt b/lldb/test/CMakeLists.txt
index ae834124a2a..33e6b13184f 100644
--- a/lldb/test/CMakeLists.txt
+++ b/lldb/test/CMakeLists.txt
@@ -3,6 +3,12 @@
add_subdirectory(API)
+# Configure and create module cache directories.
+set(LLDB_TEST_MODULE_CACHE_LLDB "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-lldb" CACHE PATH "The Clang module cache used by the Clang embedded in LLDB while running tests.")
+set(LLDB_TEST_MODULE_CACHE_CLANG "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-clang" CACHE PATH "The Clang module cache used by the Clang while building tests.")
+file(MAKE_DIRECTORY ${LLDB_TEST_MODULE_CACHE_LLDB})
+file(MAKE_DIRECTORY ${LLDB_TEST_MODULE_CACHE_CLANG})
+
# LLVM_BUILD_MODE is used in lit.site.cfg
if (CMAKE_CFG_INTDIR STREQUAL ".")
set(LLVM_BUILD_MODE ".")
@@ -17,8 +23,6 @@ endif()
get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY)
set(dotest_args_replacement ${LLVM_BUILD_MODE})
-set(LLDB_TEST_MODULE_CACHE_LLDB "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-lldb" CACHE PATH "The Clang module cache used by the Clang embedded in LLDB while running tests.")
-set(LLDB_TEST_MODULE_CACHE_CLANG "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-clang" CACHE PATH "The Clang module cache used by the Clang while building tests.")
if(LLDB_BUILT_STANDALONE)
# In paths to our build-tree, replace CMAKE_CFG_INTDIR with our configuration name placeholder.
diff --git a/lldb/test/Shell/lit.cfg.py b/lldb/test/Shell/lit.cfg.py
index 3503e956922..6f0ca673237 100644
--- a/lldb/test/Shell/lit.cfg.py
+++ b/lldb/test/Shell/lit.cfg.py
@@ -69,9 +69,9 @@ llvm_config.feature_config(
# incremental build whenever clang changes underneath, so doing it once per
# lit.py invocation is close enough.
for cachedir in [config.clang_module_cache, config.lldb_module_cache]:
- if os.path.isdir(cachedir):
- print("Deleting module cache at %s."%cachedir)
- shutil.rmtree(cachedir)
+ if os.path.isdir(cachedir):
+ print("Deleting module cache at %s."%cachedir)
+ shutil.rmtree(cachedir)
# Set a default per-test timeout of 10 minutes. Setting a timeout per test
# requires that killProcessAndChildren() is supported on the platform and
diff --git a/lldb/test/Shell/lit.site.cfg.py.in b/lldb/test/Shell/lit.site.cfg.py.in
index 459d5604541..39990a408b0 100644
--- a/lldb/test/Shell/lit.site.cfg.py.in
+++ b/lldb/test/Shell/lit.site.cfg.py.in
@@ -20,8 +20,9 @@ config.host_triple = "@LLVM_HOST_TRIPLE@"
config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32
config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
-config.lldb_module_cache = "@LLDB_TEST_MODULE_CACHE_LLDB@"
-config.clang_module_cache = "@LLDB_TEST_MODULE_CACHE_CLANG@"
+# The shell tests use their own module caches.
+config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-shell")
+config.clang_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_CLANG@", "lldb-shell")
# Support substitution of the tools and libs dirs with user parameters. This is
# used when we can't determine the tool dir at configuration time.
@@ -32,7 +33,6 @@ try:
config.lldb_libs_dir = config.lldb_libs_dir % lit_config.params
config.lldb_tools_dir = config.lldb_tools_dir % lit_config.params
config.lldb_lit_tools_dir = config.lldb_lit_tools_dir % lit_config.params
-
except KeyError as e:
key, = e.args
lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
OpenPOWER on IntegriCloud