summaryrefslogtreecommitdiffstats
path: root/llvm/utils/lit/tests
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/lit/tests')
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-shell/diff-error-0.txt3
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-shell/diff-pipes.txt15
-rw-r--r--llvm/utils/lit/tests/shtest-shell.py47
3 files changed, 47 insertions, 18 deletions
diff --git a/llvm/utils/lit/tests/Inputs/shtest-shell/diff-error-0.txt b/llvm/utils/lit/tests/Inputs/shtest-shell/diff-error-0.txt
deleted file mode 100644
index 81888cf8197..00000000000
--- a/llvm/utils/lit/tests/Inputs/shtest-shell/diff-error-0.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-# Check error on a unsupported diff (cannot be part of a pipeline).
-#
-# RUN: diff diff-error-0.txt diff-error-0.txt | echo Output
diff --git a/llvm/utils/lit/tests/Inputs/shtest-shell/diff-pipes.txt b/llvm/utils/lit/tests/Inputs/shtest-shell/diff-pipes.txt
new file mode 100644
index 00000000000..ce0abca1661
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-shell/diff-pipes.txt
@@ -0,0 +1,15 @@
+# RUN: echo foo > %t.foo
+# RUN: echo bar > %t.bar
+
+# Check output pipe.
+# RUN: diff %t.foo %t.foo | FileCheck -allow-empty -check-prefix=EMPTY %s
+# RUN: diff -u %t.foo %t.bar | FileCheck %s && false || true
+
+# Fail so lit will print output.
+# RUN: false
+
+# CHECK: @@
+# CHECK-NEXT: -foo
+# CHECK-NEXT: +bar
+
+# EMPTY-NOT: {{.}}
diff --git a/llvm/utils/lit/tests/shtest-shell.py b/llvm/utils/lit/tests/shtest-shell.py
index f947525e591..3978e4470a9 100644
--- a/llvm/utils/lit/tests/shtest-shell.py
+++ b/llvm/utils/lit/tests/shtest-shell.py
@@ -34,28 +34,20 @@
# CHECK: error: command failed with exit status: 127
# CHECK: ***
-# CHECK: FAIL: shtest-shell :: diff-error-0.txt
-# CHECK: *** TEST 'shtest-shell :: diff-error-0.txt' FAILED ***
-# CHECK: $ "diff" "diff-error-0.txt" "diff-error-0.txt"
-# CHECK: # command stderr:
-# CHECK: Unsupported: 'diff' cannot be part of a pipeline
-# CHECK: error: command failed with exit status: 127
-# CHECK: ***
-
# CHECK: FAIL: shtest-shell :: diff-error-1.txt
# CHECK: *** TEST 'shtest-shell :: diff-error-1.txt' FAILED ***
# CHECK: $ "diff" "-B" "temp1.txt" "temp2.txt"
# CHECK: # command stderr:
# CHECK: Unsupported: 'diff': option -B not recognized
-# CHECK: error: command failed with exit status: 127
+# CHECK: error: command failed with exit status: 1
# CHECK: ***
# CHECK: FAIL: shtest-shell :: diff-error-2.txt
# CHECK: *** TEST 'shtest-shell :: diff-error-2.txt' FAILED ***
# CHECK: $ "diff" "temp.txt"
# CHECK: # command stderr:
-# CHECK: Error: missing or extra operand
-# CHECK: error: command failed with exit status: 127
+# CHECK: Error: missing or extra operand
+# CHECK: error: command failed with exit status: 1
# CHECK: ***
# CHECK: FAIL: shtest-shell :: diff-error-3.txt
@@ -82,18 +74,43 @@
# CHECK: *** TEST 'shtest-shell :: diff-error-5.txt' FAILED ***
# CHECK: $ "diff"
# CHECK: # command stderr:
-# CHECK: Error: missing or extra operand
-# CHECK: error: command failed with exit status: 127
+# CHECK: Error: missing or extra operand
+# CHECK: error: command failed with exit status: 1
# CHECK: ***
# CHECK: FAIL: shtest-shell :: diff-error-6.txt
# CHECK: *** TEST 'shtest-shell :: diff-error-6.txt' FAILED ***
# CHECK: $ "diff"
# CHECK: # command stderr:
-# CHECK: Error: missing or extra operand
-# CHECK: error: command failed with exit status: 127
+# CHECK: Error: missing or extra operand
+# CHECK: error: command failed with exit status: 1
# CHECK: ***
+
+# CHECK: FAIL: shtest-shell :: diff-pipes.txt
+
+# CHECK: *** TEST 'shtest-shell :: diff-pipes.txt' FAILED ***
+
+# CHECK: $ "diff" "{{[^"]*}}.foo" "{{[^"]*}}.foo"
+# CHECK-NOT: note
+# CHECK-NOT: error
+# CHECK: $ "FileCheck"
+# CHECK-NOT: note
+# CHECK-NOT: error
+
+# CHECK: $ "diff" "-u" "{{[^"]*}}.foo" "{{[^"]*}}.bar"
+# CHECK: note: command had no output on stdout or stderr
+# CHECK: error: command failed with exit status: 1
+# CHECK: $ "FileCheck"
+# CHECK-NOT: note
+# CHECK-NOT: error
+# CHECK: $ "true"
+
+# CHECK: $ "false"
+
+# CHECK: ***
+
+
# CHECK: FAIL: shtest-shell :: diff-r-error-0.txt
# CHECK: *** TEST 'shtest-shell :: diff-r-error-0.txt' FAILED ***
# CHECK: $ "diff" "-r"
OpenPOWER on IntegriCloud