[Lldb-commits] [PATCH] D73289: [lldb/Test] Disallow using substituted binaries in shell test.

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jan 23 14:40:42 PST 2020


This revision was automatically updated to reflect the committed changes.
JDevlieghere marked an inline comment as done.
Closed by commit rG8d508c597aaf: [lldb/Test] Disallow using substituted binaries in shell test. (authored by JDevlieghere).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73289/new/

https://reviews.llvm.org/D73289

Files:
  lldb/test/Shell/helper/toolchain.py


Index: lldb/test/Shell/helper/toolchain.py
===================================================================
--- lldb/test/Shell/helper/toolchain.py
+++ lldb/test/Shell/helper/toolchain.py
@@ -14,6 +14,15 @@
     return os.path.join(config.test_exec_root, 'Shell', 'lit-lldb-init')
 
 
+def _disallow(config, execName):
+  warning = '''
+    echo '*** Do not use \'{0}\' in tests; use \'%''{0}\'. ***' &&
+    exit 1 && echo
+  '''
+  config.substitutions.append((' {0} '.format(execName),
+                               warning.format(execName)))
+
+
 def use_lldb_substitutions(config):
     # Set up substitutions for primary tools.  These tools must come from config.lldb_tools_dir
     # which is basically the build output directory.  We do not want to find these in path or
@@ -58,6 +67,10 @@
                   extra_args=build_script_args)
         ]
 
+    _disallow(config, 'lldb')
+    _disallow(config, 'debugserver')
+    _disallow(config, 'platformserver')
+
     llvm_config.add_tool_substitutions(primary_tools,
                                        [config.lldb_tools_dir])
 
@@ -141,6 +154,7 @@
     additional_tool_dirs += [config.lldb_tools_dir, config.llvm_tools_dir]
     llvm_config.add_tool_substitutions(support_tools, additional_tool_dirs)
 
+    _disallow(config, 'clang')
 
 def use_lldb_repro_substitutions(config, mode):
     lldb_init = _get_lldb_init_path(config)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73289.240018.patch
Type: text/x-patch
Size: 1402 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200123/a323dfcd/attachment.bin>


More information about the lldb-commits mailing list