File tree Expand file tree Collapse file tree 3 files changed +3
-4
lines changed Expand file tree Collapse file tree 3 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -74,14 +74,13 @@ def __init__(self, output_file):
74
74
self .skipped_codes = {lit .Test .EXCLUDED ,
75
75
lit .Test .SKIPPED , lit .Test .UNSUPPORTED }
76
76
77
- # TODO(yln): elapsed unused, put it somewhere?
78
77
def write_results (self , tests , elapsed ):
79
78
tests .sort (key = by_suite_and_test_path )
80
79
tests_by_suite = itertools .groupby (tests , lambda t : t .suite )
81
80
82
81
with open (self .output_file , 'w' ) as file :
83
82
file .write ('<?xml version="1.0" encoding="UTF-8"?>\n ' )
84
- file .write ('<testsuites>\n ' )
83
+ file .write ('<testsuites time="{time:.2f}" >\n ' . format ( time = elapsed ) )
85
84
for suite , test_iter in tests_by_suite :
86
85
self ._write_testsuite (file , suite , list (test_iter ))
87
86
file .write ('</testsuites>\n ' )
Original file line number Diff line number Diff line change 86
86
87
87
88
88
# XUNIT: <?xml version="1.0" encoding="UTF-8"?>
89
- # XUNIT-NEXT: <testsuites>
89
+ # XUNIT-NEXT: <testsuites time="{{[0-9.]+}}" >
90
90
# XUNIT-NEXT: <testsuite name="shtest-format" tests="21" failures="7" skipped="4">
91
91
92
92
# XUNIT: <testcase classname="shtest-format.external_shell" name="fail.txt" time="{{[0-9]+\.[0-9]+}}">
Original file line number Diff line number Diff line change 8
8
# RUN: FileCheck < %t.xunit.xml %s
9
9
10
10
# CHECK: <?xml version="1.0" encoding="UTF-8"?>
11
- # CHECK-NEXT: <testsuites>
11
+ # CHECK-NEXT: <testsuites time="{{[0-9.]+}}" >
12
12
# CHECK-NEXT: <testsuite name="test-data" tests="5" failures="1" skipped="3">
13
13
# CHECK-NEXT: <testcase classname="test-data.test-data" name="bad&name.ini" time="{{[0-1]\.[0-9]+}}">
14
14
# CHECK-NEXT: <failure><![CDATA[& < > ]]]]><![CDATA[> &"]]></failure>
You can’t perform that action at this time.
0 commit comments