[lldb] Use config.lldb_src_root in lit_config.load_config (NFC)
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 30 Sep 2020 06:00:18 +0000 (23:00 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 30 Sep 2020 06:05:12 +0000 (23:05 -0700)
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
lldb/test/Shell/lit.site.cfg.py.in
lldb/test/Unit/lit.site.cfg.py.in

index 0481e8f..ce2ff8e 100644 (file)
@@ -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"))
index ff4de9d..6cddd39 100644 (file)
@@ -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"))
index e2035d6..c0627b7 100644 (file)
@@ -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"))