[Lldb-commits] [PATCH] D63679: [lit] Make lit-lldb-init configurable by CMake

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 21 16:01:30 PDT 2019


JDevlieghere created this revision.
JDevlieghere added reviewers: davide, stella.stamenova, sgraenitz.
Herald added subscribers: lldb-commits, mgorny.
Herald added a project: LLDB.

This makes the `lit-lldb-init` file configurable by CMake. This matters to us downstream in swift, where we want to set environment variables with the `env` command for every test.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D63679

Files:
  lldb/lit/CMakeLists.txt
  lldb/lit/helper/toolchain.py
  lldb/lit/lit-lldb-init
  lldb/lit/lit-lldb-init.in


Index: lldb/lit/helper/toolchain.py
===================================================================
--- lldb/lit/helper/toolchain.py
+++ lldb/lit/helper/toolchain.py
@@ -34,32 +34,35 @@
     if config.llvm_libs_dir:
         build_script_args.append('--libs-dir={0}'.format(config.llvm_libs_dir))
 
+    lldb_init = os.path.join(config.test_exec_root, 'lit-lldb-init')
+
     primary_tools = [
-        ToolSubst('%lldb',
-                  command=FindTool('lldb'),
-                  extra_args=['--no-lldbinit', '-S',
-                              os.path.join(config.test_source_root,
-                                           'lit-lldb-init')]),
-        ToolSubst('%lldb-init',
-                  command=FindTool('lldb'),
-                  extra_args=['-S',
-                              os.path.join(config.test_source_root,
-                                           'lit-lldb-init')]),
+        ToolSubst(
+            '%lldb',
+            command=FindTool('lldb'),
+            extra_args=['--no-lldbinit', '-S', lldb_init]),
+        ToolSubst(
+            '%lldb-init',
+            command=FindTool('lldb'),
+            extra_args=['-S', lldb_init]),
         lldbmi,
-        ToolSubst('%debugserver',
-                  command=FindTool(dsname),
-                  extra_args=dsargs,
-                  unresolved='ignore'),
-        ToolSubst('%platformserver',
-                  command=FindTool('lldb-server'),
-                  extra_args=['platform'],
-                  unresolved='ignore'),
+        ToolSubst(
+            '%debugserver',
+            command=FindTool(dsname),
+            extra_args=dsargs,
+            unresolved='ignore'),
+        ToolSubst(
+            '%platformserver',
+            command=FindTool('lldb-server'),
+            extra_args=['platform'],
+            unresolved='ignore'),
         'lldb-test',
         'lldb-instr',
-        ToolSubst('%build',
-                  command="'" + sys.executable + "'",
-                  extra_args=build_script_args)
-        ]
+        ToolSubst(
+            '%build',
+            command="'" + sys.executable + "'",
+            extra_args=build_script_args)
+    ]
 
     llvm_config.add_tool_substitutions(primary_tools,
                                        [config.lldb_tools_dir])
Index: lldb/lit/CMakeLists.txt
===================================================================
--- lldb/lit/CMakeLists.txt
+++ lldb/lit/CMakeLists.txt
@@ -81,6 +81,10 @@
   ${CMAKE_CURRENT_SOURCE_DIR}/Suite/lit.site.cfg.in
   ${CMAKE_CURRENT_BINARY_DIR}/Suite/lit.site.cfg)
 
+configure_file(
+  ${CMAKE_CURRENT_SOURCE_DIR}/lit-lldb-init.in
+  ${CMAKE_CURRENT_BINARY_DIR}/lit-lldb-init)
+
 if(NOT LLDB_BUILT_STANDALONE)
   list(APPEND LLDB_TEST_DEPS
     FileCheck


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63679.206094.patch
Type: text/x-patch
Size: 2777 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190621/13969eb3/attachment.bin>


More information about the lldb-commits mailing list