Skip to content

Commit cc0fb0d

Browse files
authored
[LLDB] Make internal shell the default for running LLDB lit tests. (#156729)
This patch updates the lld lit test config to use the internal shell by default. This has some performance advantages (~10-15%) and also produces nicer failure output. It also updates the two LLDB tests to not require shell (so that they run under the internal shell), after first verifying that they run and pass using the internal shell; and it fixes one test that was not passing under the internal shell.
1 parent ac8e7be commit cc0fb0d

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

lldb/test/Shell/Process/Optimization.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Test warnings.
2-
REQUIRES: shell, system-darwin
2+
REQUIRES: system-darwin
33
RUN: %clang_host -O3 %S/Inputs/true.c -std=c99 -g -o %t.exe
44
RUN: %lldb -o "b main" -o r -o q -b %t.exe 2>&1 | FileCheck %s
55

lldb/test/Shell/Process/UnsupportedLanguage.test

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
Test unsupported language warning
22

3-
REQUIRES: shell
4-
53
RUN: %clang_host %S/Inputs/true.c -std=c99 -g -c -S -emit-llvm -o - \
64
RUN: | sed -e 's/DW_LANG_C99/DW_LANG_Mips_Assembler/g' >%t.ll
75
RUN: %clang_host %t.ll -g -o %t.exe

lldb/test/Shell/SymbolFile/DWARF/dwo-missing-error.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
# "a.out-dwo-missing-error.dwo".
1212
# RUN: rm -rf %t.compdir/
1313
# RUN: mkdir -p %t.compdir/a/b/
14-
# RUN: cd %t.compdir/a/b/
14+
# RUN: pushd %t.compdir/a/b/
1515
# RUN: %clang_host %S/Inputs/dwo-missing-error.c -glldb -gdwarf-5 \
1616
# RUN: -gsplit-dwarf -fdebug-prefix-map=%t.compdir=. -o a.out
1717
# RUN: rm *.dwo
1818
# RUN: %lldb a.out -s %s -o exit 2>&1 | FileCheck %s
19-
# RUN: cd -
19+
# RUN: popd
2020

2121
# Test the error message with an absolute DW_AT_comp_dir and DW_AT_dwo_name.
2222
# RUN: rm -rf %t.compdir/

lldb/test/Shell/lit.cfg.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,15 @@
2121
config.name = "lldb-shell"
2222

2323
# testFormat: The test format to use to interpret tests.
24-
config.test_format = toolchain.ShTestLldb(not llvm_config.use_lit_shell)
24+
# We prefer the lit internal shell which provides a better user experience on
25+
# failures and is faster unless the user explicitly disables it with
26+
# LIT_USE_INTERNAL_SHELL=0 env var.
27+
use_lit_shell = True
28+
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
29+
if lit_shell_env:
30+
use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
31+
32+
config.test_format = toolchain.ShTestLldb(not use_lit_shell)
2533

2634
# suffixes: A list of file extensions to treat as test files. This is overriden
2735
# by individual lit.local.cfg files in the test subdirectories.

0 commit comments

Comments
 (0)