Skip to content

Commit efec733

Browse files
committed
Revert "[lit] Echo full RUN lines in case of external shells"
Buildbots failed after this landed, as reported at: <#65267 (comment)> This reverts commit 9191ba7.
1 parent 5d7b2bf commit efec733

File tree

4 files changed

+8
-42
lines changed

4 files changed

+8
-42
lines changed

llvm/utils/lit/lit/TestRunner.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,14 +1153,8 @@ def executeScript(test, litConfig, tmpBase, commands, cwd):
11531153
for j, ln in enumerate(commands):
11541154
match = re.match(kPdbgRegex, ln)
11551155
if match:
1156-
dbg = match.group(1)
11571156
command = match.group(2)
1158-
commands[j] = f"echo '{dbg}'"
1159-
if command:
1160-
commands[j] += f": {shlex.quote(command.lstrip())} >&2 " \
1161-
f"&& {command}"
1162-
else:
1163-
commands[j] += " has no command after substitutions >&2"
1157+
commands[j] = match.expand(": '\\1'; \\2" if command else ": '\\1'")
11641158
if litConfig.per_test_coverage:
11651159
# Extract the test case name from the test object
11661160
test_case_name = test.path_in_suite[-1]

llvm/utils/lit/tests/Inputs/shtest-run-at-line/external-shell/empty-run-line.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

llvm/utils/lit/tests/Inputs/shtest-run-at-line/internal-shell/empty-run-line.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

llvm/utils/lit/tests/shtest-run-at-line.py

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,23 @@
66
# END.
77

88

9-
# CHECK: Testing: 6 tests
9+
# CHECK: Testing: 4 tests
1010

1111

1212
# In the case of the external shell, we check for only RUN lines in stderr in
1313
# case some shell implementations format "set -x" output differently.
1414

1515
# CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/basic.txt
1616

17-
# CHECK: Command Output (stderr)
18-
# CHECK-NEXT: --
19-
# CHECK: {{^}}RUN: at line 4: true
20-
# CHECK: {{^}}RUN: at line 5: false
21-
# CHECK-NOT: RUN
22-
23-
# CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/empty-run-line.txt
24-
25-
# CHECK: Command Output (stderr)
26-
# CHECK-NEXT: --
27-
# CHECK: {{^}}RUN: at line 2 has no command after substitutions
28-
# CHECK: {{^}}RUN: at line 3: false
29-
# CHECK-NOT: RUN
17+
# CHECK: RUN: at line 4
18+
# CHECK: RUN: at line 5
19+
# CHECK-NOT: RUN
3020

3121
# CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/line-continuation.txt
3222

33-
# CHECK: Command Output (stderr)
34-
# CHECK-NEXT: --
35-
# CHECK: {{^}}RUN: at line 4: echo 'foo bar' | FileCheck
36-
# CHECK: {{^}}RUN: at line 6: echo 'foo baz' | FileCheck
37-
# CHECK-NOT: RUN
23+
# CHECK: RUN: at line 4
24+
# CHECK: RUN: at line 6
25+
# CHECK-NOT: RUN
3826

3927

4028
# CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/basic.txt
@@ -49,16 +37,6 @@
4937
# CHECK-NEXT: # executed command: false
5038
# CHECK-NOT: RUN
5139

52-
# CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/empty-run-line.txt
53-
54-
# CHECK: Command Output (stdout)
55-
# CHECK-NEXT: --
56-
# CHECK-NEXT: # RUN: at line 2 has no command after substitutions
57-
# CHECK-NEXT: # RUN: at line 3
58-
# CHECK-NEXT: false
59-
# CHECK-NEXT: # executed command: false
60-
# CHECK-NOT: RUN
61-
6240
# CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/line-continuation.txt
6341

6442
# CHECK: Command Output (stdout)

0 commit comments

Comments
 (0)