[lldb] Fix TestErrorMessages test on standalone builds by adding lldb-server substitution

It seems that TestErrorMessages.test is failing on the standalone + Xcode builds
as lldb-server executable can't be found by lit's default PATH search. I assume
invoking lldb-server via a lit substitution gets this working again as
everything else is working, so that's what this patch is doing.

I had to add the lldb-server substitution as the test seems lldb-server specific
and we don't want it to default to debugserver on Darwin.

Using a substitution also seems in general like a good idea so that the commands
lit is printing on failure are using the full path to lldb-server and can be
re-run in a terminal.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D91155
This commit is contained in:
Raphael Isemann 2020-11-10 15:25:08 +01:00
parent f7eac51b9b
commit c50faf5c9d
2 changed files with 8 additions and 4 deletions

View File

@ -54,6 +54,10 @@ def use_lldb_substitutions(config):
command=FindTool('lldb'),
extra_args=['-S', lldb_init],
unresolved='fatal'),
ToolSubst('%lldb-server',
command=FindTool("lldb-server"),
extra_args=[],
unresolved='ignore'),
ToolSubst('%debugserver',
command=FindTool(dsname),
extra_args=dsargs,

View File

@ -1,13 +1,13 @@
RUN: lldb-server gdbserver --fd 2>&1 | FileCheck --check-prefixes=FD1,ALL %s
RUN: %lldb-server gdbserver --fd 2>&1 | FileCheck --check-prefixes=FD1,ALL %s
FD1: error: --fd: missing argument
RUN: lldb-server gdbserver --fd three 2>&1 | FileCheck --check-prefixes=FD2,ALL %s
RUN: %lldb-server gdbserver --fd three 2>&1 | FileCheck --check-prefixes=FD2,ALL %s
FD2: error: invalid '--fd' argument
RUN: lldb-server gdbserver --bogus 2>&1 | FileCheck --check-prefixes=BOGUS,ALL %s
RUN: %lldb-server gdbserver --bogus 2>&1 | FileCheck --check-prefixes=BOGUS,ALL %s
BOGUS: error: unknown argument '--bogus'
RUN: lldb-server gdbserver 2>&1 | FileCheck --check-prefixes=CONN,ALL %s
RUN: %lldb-server gdbserver 2>&1 | FileCheck --check-prefixes=CONN,ALL %s
CONN: error: no connection arguments
ALL: Use '{{.*}} g[dbserver] --help' for a complete list of options.