[llvm] efec733 - Revert "[lit] Echo full RUN lines in case of external shells"
Joel E. Denny via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 5 14:22:04 PDT 2023
Author: Joel E. Denny
Date: 2023-09-05T17:20:21-04:00
New Revision: efec733bf5bb97b34361c4ce49346edc6afa3866
URL: https://github.com/llvm/llvm-project/commit/efec733bf5bb97b34361c4ce49346edc6afa3866
DIFF: https://github.com/llvm/llvm-project/commit/efec733bf5bb97b34361c4ce49346edc6afa3866.diff
LOG: Revert "[lit] Echo full RUN lines in case of external shells"
Buildbots failed after this landed, as reported at:
<https://github.com/llvm/llvm-project/pull/65267#issuecomment-1707318337>
This reverts commit 9191ba7144b39f5af699993d66f3587d5da49759.
Added:
Modified:
llvm/utils/lit/lit/TestRunner.py
llvm/utils/lit/tests/shtest-run-at-line.py
Removed:
llvm/utils/lit/tests/Inputs/shtest-run-at-line/external-shell/empty-run-line.txt
llvm/utils/lit/tests/Inputs/shtest-run-at-line/internal-shell/empty-run-line.txt
################################################################################
diff --git a/llvm/utils/lit/lit/TestRunner.py b/llvm/utils/lit/lit/TestRunner.py
index 6af7d0ccd0faf91..461cf63d6b9685f 100644
--- a/llvm/utils/lit/lit/TestRunner.py
+++ b/llvm/utils/lit/lit/TestRunner.py
@@ -1153,14 +1153,8 @@ def executeScript(test, litConfig, tmpBase, commands, cwd):
for j, ln in enumerate(commands):
match = re.match(kPdbgRegex, ln)
if match:
- dbg = match.group(1)
command = match.group(2)
- commands[j] = f"echo '{dbg}'"
- if command:
- commands[j] += f": {shlex.quote(command.lstrip())} >&2 " \
- f"&& {command}"
- else:
- commands[j] += " has no command after substitutions >&2"
+ commands[j] = match.expand(": '\\1'; \\2" if command else ": '\\1'")
if litConfig.per_test_coverage:
# Extract the test case name from the test object
test_case_name = test.path_in_suite[-1]
diff --git a/llvm/utils/lit/tests/Inputs/shtest-run-at-line/external-shell/empty-run-line.txt b/llvm/utils/lit/tests/Inputs/shtest-run-at-line/external-shell/empty-run-line.txt
deleted file mode 100644
index 40a5a7d6e7cce0a..000000000000000
--- a/llvm/utils/lit/tests/Inputs/shtest-run-at-line/external-shell/empty-run-line.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-# DEFINE: %{empty} =
-# RUN: %{empty}
-# RUN: false
diff --git a/llvm/utils/lit/tests/Inputs/shtest-run-at-line/internal-shell/empty-run-line.txt b/llvm/utils/lit/tests/Inputs/shtest-run-at-line/internal-shell/empty-run-line.txt
deleted file mode 100644
index 40a5a7d6e7cce0a..000000000000000
--- a/llvm/utils/lit/tests/Inputs/shtest-run-at-line/internal-shell/empty-run-line.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-# DEFINE: %{empty} =
-# RUN: %{empty}
-# RUN: false
diff --git a/llvm/utils/lit/tests/shtest-run-at-line.py b/llvm/utils/lit/tests/shtest-run-at-line.py
index 397ae20ea4879b8..a0626f872c4c9e0 100644
--- a/llvm/utils/lit/tests/shtest-run-at-line.py
+++ b/llvm/utils/lit/tests/shtest-run-at-line.py
@@ -6,7 +6,7 @@
# END.
-# CHECK: Testing: 6 tests
+# CHECK: Testing: 4 tests
# In the case of the external shell, we check for only RUN lines in stderr in
@@ -14,27 +14,15 @@
# CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/basic.txt
-# CHECK: Command Output (stderr)
-# CHECK-NEXT: --
-# CHECK: {{^}}RUN: at line 4: true
-# CHECK: {{^}}RUN: at line 5: false
-# CHECK-NOT: RUN
-
-# CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/empty-run-line.txt
-
-# CHECK: Command Output (stderr)
-# CHECK-NEXT: --
-# CHECK: {{^}}RUN: at line 2 has no command after substitutions
-# CHECK: {{^}}RUN: at line 3: false
-# CHECK-NOT: RUN
+# CHECK: RUN: at line 4
+# CHECK: RUN: at line 5
+# CHECK-NOT: RUN
# CHECK-LABEL: FAIL: shtest-run-at-line :: external-shell/line-continuation.txt
-# CHECK: Command Output (stderr)
-# CHECK-NEXT: --
-# CHECK: {{^}}RUN: at line 4: echo 'foo bar' | FileCheck
-# CHECK: {{^}}RUN: at line 6: echo 'foo baz' | FileCheck
-# CHECK-NOT: RUN
+# CHECK: RUN: at line 4
+# CHECK: RUN: at line 6
+# CHECK-NOT: RUN
# CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/basic.txt
@@ -49,16 +37,6 @@
# CHECK-NEXT: # executed command: false
# CHECK-NOT: RUN
-# CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/empty-run-line.txt
-
-# CHECK: Command Output (stdout)
-# CHECK-NEXT: --
-# CHECK-NEXT: # RUN: at line 2 has no command after substitutions
-# CHECK-NEXT: # RUN: at line 3
-# CHECK-NEXT: false
-# CHECK-NEXT: # executed command: false
-# CHECK-NOT: RUN
-
# CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/line-continuation.txt
# CHECK: Command Output (stdout)
More information about the llvm-commits
mailing list