[llvm] [lit] Echo full RUN lines in case of external shells (PR #65267)

Joel E. Denny via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 10:10:54 PDT 2023


================
@@ -1153,8 +1153,14 @@ 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] = match.expand(": '\\1'; \\2" if command else ": '\\1'")
+            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"
----------------
jdenny-ornl wrote:

Good idea, especially given that I forgot the stderr redirection in that case.  I pushed a commit.

https://github.com/llvm/llvm-project/pull/65267


More information about the llvm-commits mailing list