1# Check the various features of the ShTest format.
2#
3# RUN: rm -f %t.xml
4# RUN: not %{lit} -j 1 -v %{inputs}/shtest-format --xunit-xml-output %t.xml > %t.out
5# RUN: FileCheck < %t.out %s
6# RUN: FileCheck --check-prefix=XUNIT < %t.xml %s
7
8# END.
9
10# CHECK: -- Testing:
11
12# CHECK: FAIL: shtest-format :: external_shell/fail.txt
13# CHECK-NEXT: *** TEST 'shtest-format :: external_shell/fail.txt' FAILED ***
14# CHECK: Command Output (stdout):
15# CHECK-NEXT: --
16# CHECK-NEXT: line 1: failed test output on stdout
17# CHECK-NEXT: line 2: failed test output on stdout
18# CHECK: Command Output (stderr):
19# CHECK-NEXT: --
20# CHECK-NEXT: cat{{(\.exe)?}}: {{cannot open does-not-exist|does-not-exist: No such file or directory}}
21# CHECK: --
22
23# CHECK: FAIL: shtest-format :: external_shell/fail_with_bad_encoding.txt
24# CHECK-NEXT: *** TEST 'shtest-format :: external_shell/fail_with_bad_encoding.txt' FAILED ***
25# CHECK: Command Output (stdout):
26# CHECK-NEXT: --
27# CHECK-NEXT: a line with bad encoding:
28# CHECK: --
29
30# CHECK: FAIL: shtest-format :: external_shell/fail_with_control_chars.txt
31# CHECK-NEXT: *** TEST 'shtest-format :: external_shell/fail_with_control_chars.txt' FAILED ***
32# CHECK: Command Output (stdout):
33# CHECK-NEXT: --
34# CHECK-NEXT: a line with {{.*}}control characters{{.*}}.
35# CHECK: --
36
37# CHECK: PASS: shtest-format :: external_shell/pass.txt
38
39# CHECK: FAIL: shtest-format :: fail.txt
40# CHECK-NEXT: *** TEST 'shtest-format :: fail.txt' FAILED ***
41# CHECK-NEXT: Script:
42# CHECK-NEXT: --
43# CHECK-NEXT: printf "line 1
44# CHECK-NEXT: false
45# CHECK-NEXT: --
46# CHECK-NEXT: Exit Code: 1
47#
48# CHECK: Command Output (stdout):
49# CHECK-NEXT: --
50# CHECK-NEXT: $ ":" "RUN: at line 1"
51# CHECK-NEXT: $ "printf"
52# CHECK-NEXT: # command output:
53# CHECK-NEXT: line 1: failed test output on stdout
54# CHECK-NEXT: line 2: failed test output on stdout
55
56# CHECK: UNRESOLVED: shtest-format :: no-test-line.txt
57# CHECK: PASS: shtest-format :: pass.txt
58# CHECK: UNSUPPORTED: shtest-format :: requires-missing.txt
59# CHECK: PASS: shtest-format :: requires-present.txt
60# CHECK: UNRESOLVED: shtest-format :: requires-star.txt
61# CHECK: UNSUPPORTED: shtest-format :: requires-triple.txt
62# CHECK: PASS: shtest-format :: unsupported-expr-false.txt
63# CHECK: UNSUPPORTED: shtest-format :: unsupported-expr-true.txt
64# CHECK: UNRESOLVED: shtest-format :: unsupported-star.txt
65# CHECK: UNSUPPORTED: shtest-format :: unsupported_dir/some-test.txt
66# CHECK: PASS: shtest-format :: xfail-expr-false.txt
67# CHECK: XFAIL: shtest-format :: xfail-expr-true.txt
68# CHECK: XFAIL: shtest-format :: xfail-feature.txt
69# CHECK: XFAIL: shtest-format :: xfail-target.txt
70# CHECK: XFAIL: shtest-format :: xfail.txt
71# CHECK: XPASS: shtest-format :: xpass.txt
72# CHECK-NEXT: *** TEST 'shtest-format :: xpass.txt' FAILED ***
73# CHECK-NEXT: Script
74# CHECK-NEXT: --
75# CHECK-NEXT: true
76# CHECK-NEXT: --
77
78# CHECK: Failed Tests (4)
79# CHECK: shtest-format :: external_shell/fail.txt
80# CHECK: shtest-format :: external_shell/fail_with_bad_encoding.txt
81# CHECK: shtest-format :: external_shell/fail_with_control_chars.txt
82# CHECK: shtest-format :: fail.txt
83
84# CHECK: Unexpectedly Passed Tests (1)
85# CHECK: shtest-format :: xpass.txt
86
87# CHECK: Testing Time:
88# CHECK: Unsupported        : 4
89# CHECK: Passed             : 6
90# CHECK: Expectedly Failed  : 4
91# CHECK: Unresolved         : 3
92# CHECK: Failed             : 4
93# CHECK: Unexpectedly Passed: 1
94
95
96# XUNIT: <?xml version="1.0" encoding="UTF-8"?>
97# XUNIT-NEXT: <testsuites time="{{[0-9.]+}}">
98# XUNIT-NEXT: <testsuite name="shtest-format" tests="22" failures="8" skipped="4">
99
100# XUNIT: <testcase classname="shtest-format.external_shell" name="fail.txt" time="{{[0-9]+\.[0-9]+}}">
101# XUNIT-NEXT: <failure{{[ ]*}}>
102# XUNIT: </failure>
103# XUNIT-NEXT: </testcase>
104
105
106# XUNIT: <testcase classname="shtest-format.external_shell" name="fail_with_bad_encoding.txt" time="{{[0-9]+\.[0-9]+}}">
107# XUNIT-NEXT: <failure{{[ ]*}}>
108# XUNIT: </failure>
109# XUNIT-NEXT: </testcase>
110
111# XUNIT: <testcase classname="shtest-format.external_shell" name="fail_with_control_chars.txt" time="{{[0-9]+\.[0-9]+}}">
112# XUNIT-NEXT: <failure><![CDATA[Script:
113# XUNIT: Command Output (stdout):
114# XUNIT-NEXT: --
115# XUNIT-NEXT: a line with [2;30;41mcontrol characters[0m.
116# XUNIT: </failure>
117# XUNIT-NEXT: </testcase>
118
119# XUNIT: <testcase classname="shtest-format.external_shell" name="pass.txt" time="{{[0-9]+\.[0-9]+}}"/>
120
121# XUNIT: <testcase classname="shtest-format.shtest-format" name="fail.txt" time="{{[0-9]+\.[0-9]+}}">
122# XUNIT-NEXT: <failure{{[ ]*}}>
123# XUNIT: </failure>
124# XUNIT-NEXT: </testcase>
125
126# XUNIT: <testcase classname="shtest-format.shtest-format" name="no-test-line.txt" time="{{[0-9]+\.[0-9]+}}">
127# XUNIT-NEXT: <failure{{[ ]*}}>
128# XUNIT: </failure>
129# XUNIT-NEXT: </testcase>
130
131# XUNIT: <testcase classname="shtest-format.shtest-format" name="pass.txt" time="{{[0-9]+\.[0-9]+}}"/>
132
133# XUNIT: <testcase classname="shtest-format.shtest-format" name="requires-missing.txt" time="{{[0-9]+\.[0-9]+}}">
134# XUNIT-NEXT:<skipped message="Missing required feature(s): a-missing-feature"/>
135
136# XUNIT: <testcase classname="shtest-format.shtest-format" name="requires-present.txt" time="{{[0-9]+\.[0-9]+}}"/>
137
138# XUNIT: <testcase classname="shtest-format.shtest-format" name="requires-star.txt" time="{{[0-9]+\.[0-9]+}}">
139# XUNIT-NEXT: <failure{{[ ]*}}>
140# XUNIT: </failure>
141# XUNIT-NEXT: </testcase>
142
143
144# XUNIT: <testcase classname="shtest-format.shtest-format" name="requires-triple.txt" time="{{[0-9]+\.[0-9]+}}">
145# XUNIT-NEXT:<skipped message="Missing required feature(s): x86_64"/>
146
147# XUNIT: <testcase classname="shtest-format.shtest-format" name="unsupported-expr-false.txt" time="{{[0-9]+\.[0-9]+}}"/>
148
149# XUNIT: <testcase classname="shtest-format.shtest-format" name="unsupported-expr-true.txt" time="{{[0-9]+\.[0-9]+}}">
150# XUNIT-NEXT:<skipped message="Unsupported configuration"/>
151
152# XUNIT: <testcase classname="shtest-format.shtest-format" name="unsupported-star.txt" time="{{[0-9]+\.[0-9]+}}">
153# XUNIT-NEXT: <failure{{[ ]*}}>
154# XUNIT: </failure>
155# XUNIT-NEXT: </testcase>
156
157# XUNIT: <testcase classname="shtest-format.unsupported_dir" name="some-test.txt" time="{{[0-9]+\.[0-9]+}}">
158# XUNIT-NEXT:<skipped message="Unsupported configuration"/>
159
160# XUNIT: <testcase classname="shtest-format.shtest-format" name="xfail-expr-false.txt" time="{{[0-9]+\.[0-9]+}}"/>
161
162# XUNIT: <testcase classname="shtest-format.shtest-format" name="xfail-expr-true.txt" time="{{[0-9]+\.[0-9]+}}"/>
163
164# XUNIT: <testcase classname="shtest-format.shtest-format" name="xfail-feature.txt" time="{{[0-9]+\.[0-9]+}}"/>
165
166# XUNIT: <testcase classname="shtest-format.shtest-format" name="xfail-target.txt" time="{{[0-9]+\.[0-9]+}}"/>
167
168# XUNIT: <testcase classname="shtest-format.shtest-format" name="xfail.txt" time="{{[0-9]+\.[0-9]+}}"/>
169
170# XUNIT: <testcase classname="shtest-format.shtest-format" name="xpass.txt" time="{{[0-9]+\.[0-9]+}}">
171# XUNIT-NEXT: <failure{{[ ]*}}>
172# XUNIT: </failure>
173# XUNIT-NEXT: </testcase>
174
175# XUNIT: </testsuite>
176# XUNIT-NEXT: </testsuites>
177