61 changes: 32 additions & 29 deletions llvm/utils/lit/tests/shtest-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,19 @@

# CHECK: PASS: shtest-format :: external_shell/pass.txt

# CHECK: FAIL: shtest-format :: fail.txt
# CHECK-NEXT: *** TEST 'shtest-format :: fail.txt' FAILED ***
# CHECK-NEXT: Script:
# CHECK-NEXT: --
# CHECK-NEXT: printf "line 1
# CHECK-NEXT: false
# CHECK-NEXT: --
# CHECK-NEXT: Exit Code: 1
#
# CHECK: Command Output (stdout):
# CHECK-NEXT: --
# CHECK-NEXT: $ ":" "RUN: at line 1"
# CHECK-NEXT: $ "printf"
# CHECK-NEXT: # command output:
# CHECK-NEXT: line 1: failed test output on stdout
# CHECK-NEXT: line 2: failed test output on stdout
# CHECK: FAIL: shtest-format :: fail.txt
# CHECK-NEXT: *** TEST 'shtest-format :: fail.txt' FAILED ***
# CHECK-NEXT: Exit Code: 1
# CHECK-EMPTY:
# CHECK-NEXT: Command Output (stdout):
# CHECK-NEXT: --
# CHECK-NEXT: $ ":" "RUN: at line 1"
# CHECK-NEXT: $ "printf"
# CHECK-NEXT: # command output:
# CHECK-NEXT: line 1: failed test output on stdout
# CHECK-NEXT: line 2: failed test output on stdout
# CHECK-NEXT: $ ":" "RUN: at line 2"
# CHECK-NEXT: $ "false"

# CHECK: UNRESOLVED: shtest-format :: no-test-line.txt
# CHECK: PASS: shtest-format :: pass.txt
Expand All @@ -69,12 +66,15 @@
# CHECK: XFAIL: shtest-format :: xfail-feature.txt
# CHECK: XFAIL: shtest-format :: xfail-target.txt
# CHECK: XFAIL: shtest-format :: xfail.txt
# CHECK: XPASS: shtest-format :: xpass.txt
# CHECK-NEXT: *** TEST 'shtest-format :: xpass.txt' FAILED ***
# CHECK-NEXT: Script
# CHECK-NEXT: --
# CHECK-NEXT: true
# CHECK-NEXT: --

# CHECK: XPASS: shtest-format :: xpass.txt
# CHECK-NEXT: *** TEST 'shtest-format :: xpass.txt' FAILED ***
# CHECK-NEXT: Exit Code: 0
# CHECK-EMPTY:
# CHECK-NEXT: Command Output (stdout):
# CHECK-NEXT: --
# CHECK-NEXT: $ ":" "RUN: at line 1"
# CHECK-NEXT: $ "true"

# CHECK: Failed Tests (4)
# CHECK: shtest-format :: external_shell/fail.txt
Expand Down Expand Up @@ -109,13 +109,16 @@
# XUNIT: </failure>
# XUNIT-NEXT: </testcase>

# XUNIT: <testcase classname="shtest-format.external_shell" name="fail_with_control_chars.txt" time="{{[0-9]+\.[0-9]+}}">
# XUNIT-NEXT: <failure><![CDATA[Script:
# XUNIT: Command Output (stdout):
# XUNIT-NEXT: --
# XUNIT-NEXT: a line with [2;30;41mcontrol characters[0m.
# XUNIT: </failure>
# XUNIT-NEXT: </testcase>
# XUNIT: <testcase classname="shtest-format.external_shell" name="fail_with_control_chars.txt" time="{{[0-9]+\.[0-9]+}}">
# XUNIT-NEXT: <failure><![CDATA[Exit Code: 1
# XUNIT-EMPTY:
# XUNIT-NEXT: Command Output (stdout):
# XUNIT-NEXT: --
# XUNIT-NEXT: a line with [2;30;41mcontrol characters[0m.
# XUNIT-EMPTY:
# XUNIT-NEXT: --
# XUNIT: ]]></failure>
# XUNIT-NEXT: </testcase>

# XUNIT: <testcase classname="shtest-format.external_shell" name="pass.txt" time="{{[0-9]+\.[0-9]+}}"/>

Expand Down
22 changes: 0 additions & 22 deletions llvm/utils/lit/tests/shtest-inject.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,13 @@

# RUN: %{lit} %{inputs}/shtest-inject/test-empty.txt --show-all | FileCheck --check-prefix=CHECK-TEST1 %s
#
# CHECK-TEST1: Script:
# CHECK-TEST1: --
# CHECK-TEST1: echo "THIS WAS"
# CHECK-TEST1: echo "INJECTED"
# CHECK-TEST1: --
#
# CHECK-TEST1: THIS WAS
# CHECK-TEST1: INJECTED
#
# CHECK-TEST1: Passed: 1

# RUN: %{lit} %{inputs}/shtest-inject/test-one.txt --show-all | FileCheck --check-prefix=CHECK-TEST2 %s
#
# CHECK-TEST2: Script:
# CHECK-TEST2: --
# CHECK-TEST2: echo "THIS WAS"
# CHECK-TEST2: echo "INJECTED"
# CHECK-TEST2: echo "IN THE FILE"
# CHECK-TEST2: --
#
# CHECK-TEST2: THIS WAS
# CHECK-TEST2: INJECTED
# CHECK-TEST2: IN THE FILE
Expand All @@ -30,15 +17,6 @@

# RUN: %{lit} %{inputs}/shtest-inject/test-many.txt --show-all | FileCheck --check-prefix=CHECK-TEST3 %s
#
# CHECK-TEST3: Script:
# CHECK-TEST3: --
# CHECK-TEST3: echo "THIS WAS"
# CHECK-TEST3: echo "INJECTED"
# CHECK-TEST3: echo "IN THE FILE"
# CHECK-TEST3: echo "IF IT WORKS"
# CHECK-TEST3: echo "AS EXPECTED"
# CHECK-TEST3: --
#
# CHECK-TEST3: THIS WAS
# CHECK-TEST3: INJECTED
# CHECK-TEST3: IN THE FILE
Expand Down
3 changes: 0 additions & 3 deletions llvm/utils/lit/tests/shtest-not.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@

# CHECK: FAIL: shtest-not :: not-calls-fail2.txt {{.*}}
# CHECK-NEXT: {{.*}} TEST 'shtest-not :: not-calls-fail2.txt' FAILED {{.*}}
# CHECK-NEXT: Script:
# CHECK-NEXT: --
# CHECK: --
# CHECK-NEXT: Exit Code: 1

# CHECK: FAIL: shtest-not :: not-calls-mkdir.txt {{.*}}
Expand Down
3 changes: 0 additions & 3 deletions llvm/utils/lit/tests/shtest-output-printing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

# CHECK: FAIL: shtest-output-printing :: basic.txt
# CHECK-NEXT: *** TEST 'shtest-output-printing :: basic.txt' FAILED ***
# CHECK-NEXT: Script:
# CHECK-NEXT: --
# CHECK: --
# CHECK-NEXT: Exit Code: 1
#
# CHECK: Command Output
Expand Down
30 changes: 4 additions & 26 deletions llvm/utils/lit/tests/shtest-run-at-line.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Check that -vv makes the line number of the failing RUN command clear.
# (-v is actually sufficient in the case of the internal shell.)
# Check that -a/-v/-vv makes the line number of the failing RUN command clear.

# RUN: not %{lit} -vv %{inputs}/shtest-run-at-line > %t.out
# RUN: FileCheck --input-file %t.out %s
#
# RUN: not %{lit} -a %{inputs}/shtest-run-at-line | FileCheck %s
# RUN: not %{lit} -v %{inputs}/shtest-run-at-line | FileCheck %s
# RUN: not %{lit} -vv %{inputs}/shtest-run-at-line | FileCheck %s
# END.


Expand All @@ -15,34 +14,19 @@

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

# CHECK: Script:
# CHECK: RUN: at line 4{{.*}} true
# CHECK-NEXT: RUN: at line 5{{.*}} false
# CHECK-NEXT: RUN: at line 6{{.*}} true

# 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: Script:
# CHECK: RUN: at line 4{{.*}} echo 'foo bar' | FileCheck
# CHECK-NEXT: RUN: at line 6{{.*}} echo 'foo baz' | FileCheck
# CHECK-NEXT: RUN: at line 9{{.*}} echo 'foo bar' | FileCheck

# CHECK: RUN: at line 4
# CHECK: RUN: at line 6
# CHECK-NOT: RUN


# CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/basic.txt

# CHECK: Script:
# CHECK: : 'RUN: at line 1'; true
# CHECK-NEXT: : 'RUN: at line 2'; false
# CHECK-NEXT: : 'RUN: at line 3'; true

# CHECK: Command Output (stdout)
# CHECK: $ ":" "RUN: at line 1"
# CHECK-NEXT: $ "true"
Expand All @@ -52,12 +36,6 @@

# CHECK-LABEL: FAIL: shtest-run-at-line :: internal-shell/line-continuation.txt

# CHECK: Script:
# CHECK: : 'RUN: at line 1'; : first line continued to second line
# CHECK-NEXT: : 'RUN: at line 3'; echo 'foo bar' | FileCheck
# CHECK-NEXT: : 'RUN: at line 5'; echo 'foo baz' | FileCheck
# CHECK-NEXT: : 'RUN: at line 8'; echo 'foo bar' | FileCheck

# CHECK: Command Output (stdout)
# CHECK: $ ":" "RUN: at line 1"
# CHECK-NEXT: $ ":" "first" "line" "continued" "to" "second" "line"
Expand Down