2013-01-31 19:05:01 +01:00
|
|
|
# Check the various features of the ShTest format.
|
2021-03-22 12:44:30 +01:00
|
|
|
|
|
|
|
# FIXME: this test depends on order of tests
|
|
|
|
# RUN: rm -f %{inputs}/shtest-format/.lit_test_times.txt
|
|
|
|
|
2018-07-23 20:08:36 +02:00
|
|
|
# RUN: rm -f %t.xml
|
|
|
|
# RUN: not %{lit} -j 1 -v %{inputs}/shtest-format --xunit-xml-output %t.xml > %t.out
|
2013-01-31 19:05:01 +01:00
|
|
|
# RUN: FileCheck < %t.out %s
|
2018-07-23 20:08:36 +02:00
|
|
|
# RUN: FileCheck --check-prefix=XUNIT < %t.xml %s
|
|
|
|
|
2013-01-31 19:05:01 +01:00
|
|
|
# END.
|
|
|
|
|
|
|
|
# CHECK: -- Testing:
|
|
|
|
|
|
|
|
# CHECK: FAIL: shtest-format :: external_shell/fail.txt
|
2013-08-15 00:21:01 +02:00
|
|
|
# CHECK-NEXT: *** TEST 'shtest-format :: external_shell/fail.txt' FAILED ***
|
|
|
|
# CHECK: Command Output (stdout):
|
|
|
|
# CHECK-NEXT: --
|
|
|
|
# CHECK-NEXT: line 1: failed test output on stdout
|
|
|
|
# CHECK-NEXT: line 2: failed test output on stdout
|
2013-01-31 19:05:01 +01:00
|
|
|
# CHECK: Command Output (stderr):
|
2013-08-15 00:21:01 +02:00
|
|
|
# CHECK-NEXT: --
|
2019-05-01 17:47:16 +02:00
|
|
|
# CHECK-NEXT: cat{{(\.exe)?}}: {{cannot open does-not-exist|does-not-exist: No such file or directory}}
|
2013-08-15 00:21:01 +02:00
|
|
|
# CHECK: --
|
|
|
|
|
|
|
|
# CHECK: FAIL: shtest-format :: external_shell/fail_with_bad_encoding.txt
|
|
|
|
# CHECK-NEXT: *** TEST 'shtest-format :: external_shell/fail_with_bad_encoding.txt' FAILED ***
|
|
|
|
# CHECK: Command Output (stdout):
|
|
|
|
# CHECK-NEXT: --
|
|
|
|
# CHECK-NEXT: a line with bad encoding:
|
2013-01-31 19:05:01 +01:00
|
|
|
# CHECK: --
|
|
|
|
|
2020-08-06 09:53:47 +02:00
|
|
|
# CHECK: FAIL: shtest-format :: external_shell/fail_with_control_chars.txt
|
|
|
|
# CHECK-NEXT: *** TEST 'shtest-format :: external_shell/fail_with_control_chars.txt' FAILED ***
|
|
|
|
# CHECK: Command Output (stdout):
|
|
|
|
# CHECK-NEXT: --
|
|
|
|
# CHECK-NEXT: a line with {{.*}}control characters{{.*}}.
|
|
|
|
# CHECK: --
|
|
|
|
|
2013-01-31 19:05:01 +01:00
|
|
|
# CHECK: PASS: shtest-format :: external_shell/pass.txt
|
|
|
|
|
|
|
|
# CHECK: FAIL: shtest-format :: fail.txt
|
2013-08-15 00:21:01 +02:00
|
|
|
# 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: --
|
[lit] Report line number for failed RUN command
(Relands r333584, reverted in 333592.)
When debugging test failures with -vv (or -v in the case of the
internal shell), this makes it easier to locate the RUN line that
failed. For example, clang's test/Driver/linux-ld.c has 892 total RUN
lines, and clang's test/Driver/arm-cortex-cpus.c has 424 RUN lines
after concatenation for line continuations.
When reading the generated shell script, this also makes it easier to
locate the RUN line that produced each command.
To support reporting RUN line numbers in the case of the internal
shell, this patch extends the internal shell to support the null
command, ":", except pipelines are not supported.
To support reporting RUN line numbers in the case of windows cmd.exe
as the external shell, this patch extends -vv to set "echo on" instead
of "echo off" in bat files. (Support for windows cmd.exe as a lit
external shell will likely be dropped later, but I found out too
late.)
Reviewed By: delcypher, asmith, stella.stamenova, jmorse, lebedev.ri, rnk
Differential Revision: https://reviews.llvm.org/D44598
llvm-svn: 333614
2018-05-31 02:55:32 +02:00
|
|
|
# CHECK-NEXT: $ ":" "RUN: at line 1"
|
2016-06-03 01:49:42 +02:00
|
|
|
# CHECK-NEXT: $ "printf"
|
|
|
|
# CHECK-NEXT: # command output:
|
2013-08-15 00:21:01 +02:00
|
|
|
# CHECK-NEXT: line 1: failed test output on stdout
|
|
|
|
# CHECK-NEXT: line 2: failed test output on stdout
|
2013-01-31 19:05:01 +01:00
|
|
|
|
|
|
|
# CHECK: UNRESOLVED: shtest-format :: no-test-line.txt
|
|
|
|
# CHECK: PASS: shtest-format :: pass.txt
|
|
|
|
# CHECK: UNSUPPORTED: shtest-format :: requires-missing.txt
|
|
|
|
# CHECK: PASS: shtest-format :: requires-present.txt
|
2017-01-25 03:26:03 +01:00
|
|
|
# CHECK: UNRESOLVED: shtest-format :: requires-star.txt
|
|
|
|
# CHECK: UNSUPPORTED: shtest-format :: requires-triple.txt
|
|
|
|
# CHECK: PASS: shtest-format :: unsupported-expr-false.txt
|
|
|
|
# CHECK: UNSUPPORTED: shtest-format :: unsupported-expr-true.txt
|
|
|
|
# CHECK: UNRESOLVED: shtest-format :: unsupported-star.txt
|
2013-01-31 19:05:01 +01:00
|
|
|
# CHECK: UNSUPPORTED: shtest-format :: unsupported_dir/some-test.txt
|
2017-01-25 03:26:03 +01:00
|
|
|
# CHECK: PASS: shtest-format :: xfail-expr-false.txt
|
|
|
|
# CHECK: XFAIL: shtest-format :: xfail-expr-true.txt
|
2013-01-31 19:05:01 +01:00
|
|
|
# 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
|
2013-08-22 00:26:42 +02:00
|
|
|
# CHECK-NEXT: *** TEST 'shtest-format :: xpass.txt' FAILED ***
|
|
|
|
# CHECK-NEXT: Script
|
|
|
|
# CHECK-NEXT: --
|
|
|
|
# CHECK-NEXT: true
|
|
|
|
# CHECK-NEXT: --
|
2013-01-31 19:05:01 +01:00
|
|
|
|
2020-08-06 09:53:47 +02:00
|
|
|
# CHECK: Failed Tests (4)
|
2013-01-31 19:05:01 +01:00
|
|
|
# CHECK: shtest-format :: external_shell/fail.txt
|
2013-08-15 00:21:01 +02:00
|
|
|
# CHECK: shtest-format :: external_shell/fail_with_bad_encoding.txt
|
2020-08-06 09:53:47 +02:00
|
|
|
# CHECK: shtest-format :: external_shell/fail_with_control_chars.txt
|
2013-01-31 19:05:01 +01:00
|
|
|
# CHECK: shtest-format :: fail.txt
|
|
|
|
|
2020-04-08 07:48:39 +02:00
|
|
|
# CHECK: Unexpectedly Passed Tests (1)
|
2019-02-28 06:46:04 +01:00
|
|
|
# CHECK: shtest-format :: xpass.txt
|
|
|
|
|
|
|
|
# CHECK: Testing Time:
|
2020-04-08 07:48:39 +02:00
|
|
|
# CHECK: Unsupported : 4
|
2020-06-18 22:51:53 +02:00
|
|
|
# CHECK: Passed : 6
|
2020-04-08 07:48:39 +02:00
|
|
|
# CHECK: Expectedly Failed : 4
|
|
|
|
# CHECK: Unresolved : 3
|
2020-08-06 09:53:47 +02:00
|
|
|
# CHECK: Failed : 4
|
2020-04-08 07:48:39 +02:00
|
|
|
# CHECK: Unexpectedly Passed: 1
|
2018-07-23 20:08:36 +02:00
|
|
|
|
|
|
|
|
2020-05-02 00:20:18 +02:00
|
|
|
# XUNIT: <?xml version="1.0" encoding="UTF-8"?>
|
2020-07-23 11:45:55 +02:00
|
|
|
# XUNIT-NEXT: <testsuites time="{{[0-9.]+}}">
|
2020-08-06 09:53:47 +02:00
|
|
|
# XUNIT-NEXT: <testsuite name="shtest-format" tests="22" failures="8" skipped="4">
|
2018-07-23 20:08:36 +02:00
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.external_shell" name="fail.txt" time="{{[0-9]+\.[0-9]+}}">
|
|
|
|
# XUNIT-NEXT: <failure{{[ ]*}}>
|
|
|
|
# XUNIT: </failure>
|
|
|
|
# XUNIT-NEXT: </testcase>
|
|
|
|
|
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.external_shell" name="fail_with_bad_encoding.txt" time="{{[0-9]+\.[0-9]+}}">
|
|
|
|
# XUNIT-NEXT: <failure{{[ ]*}}>
|
|
|
|
# XUNIT: </failure>
|
|
|
|
# XUNIT-NEXT: </testcase>
|
|
|
|
|
2020-08-06 09:53:47 +02:00
|
|
|
# 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>
|
|
|
|
|
2018-07-23 20:08:36 +02:00
|
|
|
# XUNIT: <testcase classname="shtest-format.external_shell" name="pass.txt" time="{{[0-9]+\.[0-9]+}}"/>
|
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="fail.txt" time="{{[0-9]+\.[0-9]+}}">
|
|
|
|
# XUNIT-NEXT: <failure{{[ ]*}}>
|
|
|
|
# XUNIT: </failure>
|
|
|
|
# XUNIT-NEXT: </testcase>
|
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="no-test-line.txt" time="{{[0-9]+\.[0-9]+}}">
|
|
|
|
# XUNIT-NEXT: <failure{{[ ]*}}>
|
|
|
|
# XUNIT: </failure>
|
|
|
|
# XUNIT-NEXT: </testcase>
|
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="pass.txt" time="{{[0-9]+\.[0-9]+}}"/>
|
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="requires-missing.txt" time="{{[0-9]+\.[0-9]+}}">
|
2020-05-02 00:20:18 +02:00
|
|
|
# XUNIT-NEXT:<skipped message="Missing required feature(s): a-missing-feature"/>
|
2018-07-23 20:08:36 +02:00
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="requires-present.txt" time="{{[0-9]+\.[0-9]+}}"/>
|
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="requires-star.txt" time="{{[0-9]+\.[0-9]+}}">
|
|
|
|
# XUNIT-NEXT: <failure{{[ ]*}}>
|
|
|
|
# XUNIT: </failure>
|
|
|
|
# XUNIT-NEXT: </testcase>
|
|
|
|
|
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="requires-triple.txt" time="{{[0-9]+\.[0-9]+}}">
|
2020-05-02 00:20:18 +02:00
|
|
|
# XUNIT-NEXT:<skipped message="Missing required feature(s): x86_64"/>
|
2018-07-23 20:08:36 +02:00
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="unsupported-expr-false.txt" time="{{[0-9]+\.[0-9]+}}"/>
|
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="unsupported-expr-true.txt" time="{{[0-9]+\.[0-9]+}}">
|
2020-06-06 00:45:43 +02:00
|
|
|
# XUNIT-NEXT:<skipped message="Unsupported configuration"/>
|
2018-07-23 20:08:36 +02:00
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="unsupported-star.txt" time="{{[0-9]+\.[0-9]+}}">
|
|
|
|
# XUNIT-NEXT: <failure{{[ ]*}}>
|
|
|
|
# XUNIT: </failure>
|
|
|
|
# XUNIT-NEXT: </testcase>
|
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.unsupported_dir" name="some-test.txt" time="{{[0-9]+\.[0-9]+}}">
|
2020-06-06 00:45:43 +02:00
|
|
|
# XUNIT-NEXT:<skipped message="Unsupported configuration"/>
|
2018-07-23 20:08:36 +02:00
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="xfail-expr-false.txt" time="{{[0-9]+\.[0-9]+}}"/>
|
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="xfail-expr-true.txt" time="{{[0-9]+\.[0-9]+}}"/>
|
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="xfail-feature.txt" time="{{[0-9]+\.[0-9]+}}"/>
|
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="xfail-target.txt" time="{{[0-9]+\.[0-9]+}}"/>
|
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="xfail.txt" time="{{[0-9]+\.[0-9]+}}"/>
|
|
|
|
|
|
|
|
# XUNIT: <testcase classname="shtest-format.shtest-format" name="xpass.txt" time="{{[0-9]+\.[0-9]+}}">
|
|
|
|
# XUNIT-NEXT: <failure{{[ ]*}}>
|
|
|
|
# XUNIT: </failure>
|
|
|
|
# XUNIT-NEXT: </testcase>
|
|
|
|
|
|
|
|
# XUNIT: </testsuite>
|
|
|
|
# XUNIT-NEXT: </testsuites>
|