[lit] Improve logging with file redirection.
- This will cause lit to automatically include the first 1K of data in
redirected output files when a command fails (previously if the command
failed, but the main point of the test was, say, a `FileCheck` later on, then
the log wasn't helpful in showing why the command failed).
llvm-svn: 272021
diff --git a/llvm/utils/lit/tests/Inputs/shtest-output-printing/basic.txt b/llvm/utils/lit/tests/Inputs/shtest-output-printing/basic.txt
index 1720c60..4899c7e 100644
--- a/llvm/utils/lit/tests/Inputs/shtest-output-printing/basic.txt
+++ b/llvm/utils/lit/tests/Inputs/shtest-output-printing/basic.txt
@@ -1,3 +1,3 @@
# RUN: true
# RUN: echo hi
-# RUN: false
+# RUN: wc missing-file &> %t.out
diff --git a/llvm/utils/lit/tests/shtest-output-printing.py b/llvm/utils/lit/tests/shtest-output-printing.py
index 1d5fc04..24580b3 100644
--- a/llvm/utils/lit/tests/shtest-output-printing.py
+++ b/llvm/utils/lit/tests/shtest-output-printing.py
@@ -1,7 +1,7 @@
# Check the various features of the ShTest format.
#
# RUN: not %{lit} -j 1 -v %{inputs}/shtest-output-printing > %t.out
-# RUN: FileCheck < %t.out %s
+# RUN: FileCheck --input-file %t.out %s
#
# END.
@@ -21,6 +21,8 @@
# CHECK-NEXT: # command output:
# CHECK-NEXT: hi
#
-# CHECK: $ "false"
-# CHECK-NEXT: note: command had no output on stdout or stderr
+# CHECK: $ "wc" "missing-file"
+# CHECK-NEXT: # redirected output from '{{.*}}/basic.txt.tmp.out':
+# CHECK-NEXT: missing-file{{.*}} No such file or directory
+# CHECK: note: command had no output on stdout or stderr
# CHECK-NEXT: error: command failed with exit status: 1
diff --git a/llvm/utils/lit/tests/shtest-shell.py b/llvm/utils/lit/tests/shtest-shell.py
index 379b040..18b80cd 100644
--- a/llvm/utils/lit/tests/shtest-shell.py
+++ b/llvm/utils/lit/tests/shtest-shell.py
@@ -1,7 +1,7 @@
# Check the internal shell handling component of the ShTest format.
#
# RUN: not %{lit} -j 1 -v %{inputs}/shtest-shell > %t.out
-# RUN: FileCheck < %t.out %s
+# RUN: FileCheck --input-file %t.out %s
#
# END.