Skip to content

Commit 971863e

Browse files
committed
[llvm][lit] Make Xunit time test regex less strict
I got a report that downstream this test failed and the cause was that it took longer than the 1 second we expected to run one of the test cases. There's no reason for this test to be that specific, so I've changed all the [0-1] to [0-9]+. This test does not care whether the times make any sense, only that they exist. A couple exisitng regex here make the decimal point optional, and on my machine I always seem to get `.00`. So I think they are always finding a decimal point anyway. I've left them just on the slim chance that some platform happens to print that time as a single number if it's a whole number of seconds.
1 parent 17952b3 commit 971863e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/utils/lit/tests/xunit-output.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010
# CHECK: <?xml version="1.0" encoding="UTF-8"?>
1111
# CHECK-NEXT: <testsuites time="{{[0-9.]+}}">
1212
# CHECK-NEXT: <testsuite name="test-data" tests="5" failures="1" skipped="3" time="{{[0-9.]+}}">
13-
# CHECK-NEXT: <testcase classname="test-data.test-data" name="bad&amp;name.ini" time="{{[0-1]\.[0-9]+}}">
13+
# CHECK-NEXT: <testcase classname="test-data.test-data" name="bad&amp;name.ini" time="{{[0-9]+\.[0-9]+}}">
1414
# CHECK-NEXT: <failure><![CDATA[& < > ]]]]><![CDATA[> &"]]></failure>
1515
# CHECK-NEXT: </testcase>
16-
# CHECK-NEXT: <testcase classname="test-data.test-data" name="excluded.ini" time="{{[0-1]\.[0-9]+}}">
16+
# CHECK-NEXT: <testcase classname="test-data.test-data" name="excluded.ini" time="{{[0-9]+\.[0-9]+}}">
1717
# CHECK-NEXT: <skipped message="Test not selected (--filter, --max-tests)"/>
1818
# CHECK-NEXT: </testcase>
19-
# CHECK-NEXT: <testcase classname="test-data.test-data" name="missing_feature.ini" time="{{[0-1]\.[0-9]+}}">
19+
# CHECK-NEXT: <testcase classname="test-data.test-data" name="missing_feature.ini" time="{{[0-9]+\.[0-9]+}}">
2020
# CHECK-NEXT: <skipped message="Missing required feature(s): dummy_feature"/>
2121
# CHECK-NEXT: </testcase>
22-
# CHECK-NEXT: <testcase classname="test-data.test-data" name="pass.ini" time="{{[0-1]\.[0-9]+}}"/>
23-
# CHECK-NEXT: <testcase classname="test-data.test-data" name="unsupported.ini" time="{{[0-1]\.[0-9]+}}">
22+
# CHECK-NEXT: <testcase classname="test-data.test-data" name="pass.ini" time="{{[0-9]+\.[0-9]+}}"/>
23+
# CHECK-NEXT: <testcase classname="test-data.test-data" name="unsupported.ini" time="{{[0-9]+\.[0-9]+}}">
2424
# CHECK-NEXT: <skipped message="Unsupported configuration"/>
2525
# CHECK-NEXT: </testcase>
2626
# CHECK-NEXT: </testsuite>

0 commit comments

Comments
 (0)