Skip to content

[lldb/Test] Disallow using substituted binaries in shell test. #648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions lldb/test/Shell/helper/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
from lit.llvm.subst import FindTool
from lit.llvm.subst import ToolSubst

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
Expand Down Expand Up @@ -53,6 +62,10 @@ def use_lldb_substitutions(config):
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])

Expand Down Expand Up @@ -135,3 +148,5 @@ def use_support_substitutions(config):
'llvm-objcopy', 'lli']
additional_tool_dirs += [config.lldb_tools_dir, config.llvm_tools_dir]
llvm_config.add_tool_substitutions(support_tools, additional_tool_dirs)

_disallow(config, 'clang')