From 154860af338f7b0c82cb04e91d6f199aa72cfdff Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Tue, 29 Sep 2020 23:00:18 -0700 Subject: [PATCH] [lldb] Use config.lldb_src_root in lit_config.load_config (NFC) Rather than relaying on CMake to substitute the full path to the lldb source root, use the value set in config.lldb_src_root. This makes it slightly easier to write a custom lit.site.cfg.py. --- lldb/test/API/lit.site.cfg.py.in | 2 +- lldb/test/Shell/lit.site.cfg.py.in | 3 ++- lldb/test/Unit/lit.site.cfg.py.in | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lldb/test/API/lit.site.cfg.py.in b/lldb/test/API/lit.site.cfg.py.in index 0481e8fecc73..ce2ff8e21d0b 100644 --- a/lldb/test/API/lit.site.cfg.py.in +++ b/lldb/test/API/lit.site.cfg.py.in @@ -69,4 +69,4 @@ except KeyError as e: lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key)) # Let the main config do the real work. -lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/API/lit.cfg.py") +lit_config.load_config(config, os.path.join(config.lldb_src_root, "test", "API", "lit.cfg.py")) diff --git a/lldb/test/Shell/lit.site.cfg.py.in b/lldb/test/Shell/lit.site.cfg.py.in index ff4de9d527de..6cddd3937628 100644 --- a/lldb/test/Shell/lit.site.cfg.py.in +++ b/lldb/test/Shell/lit.site.cfg.py.in @@ -6,6 +6,7 @@ config.llvm_tools_dir = "@LLVM_TOOLS_DIR@" config.llvm_libs_dir = "@LLVM_LIBS_DIR@" config.llvm_shlib_dir = "@SHLIBDIR@" config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@" +config.lldb_src_root = "@LLDB_SOURCE_DIR@" config.lldb_obj_root = "@LLDB_BINARY_DIR@" config.lldb_libs_dir = "@LLDB_LIBS_DIR@" config.lldb_tools_dir = "@LLDB_TOOLS_DIR@" @@ -42,4 +43,4 @@ import lit.llvm lit.llvm.initialize(lit_config, config) # Let the main config do the real work. -lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/Shell/lit.cfg.py") +lit_config.load_config(config, os.path.join(config.lldb_src_root, "test", "Shell", "lit.cfg.py")) diff --git a/lldb/test/Unit/lit.site.cfg.py.in b/lldb/test/Unit/lit.site.cfg.py.in index e2035d678cd9..c0627b772362 100644 --- a/lldb/test/Unit/lit.site.cfg.py.in +++ b/lldb/test/Unit/lit.site.cfg.py.in @@ -26,4 +26,4 @@ import lit.llvm lit.llvm.initialize(lit_config, config) # Let the main config do the real work. -lit_config.load_config(config, "@LLDB_SOURCE_DIR@/test/Unit/lit.cfg.py") +lit_config.load_config(config, os.path.join(config.lldb_src_root, "test", "Unit", "lit.cfg.py"))