Skip to content

Commit 38a6816

Browse files
authored
fix: Use run start and end time to compute duration of test run (#29)
Fixes #26.
1 parent 87aa46a commit 38a6816

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44

55
* Refactor to support [core testlogger][]
66
* Compatibility: minimum framework is netstandard1.5 and TestPlatform 15.5.0
7+
* Use test run start and end times for run duration reporting for assembly. See #26
78

89
[core testlogger]: https://github.com/spekt/testlogger

src/Xunit.Xml.TestLogger/XunitXmlSerializer.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ orderby resultsByType.Key
8282
int failed = 0;
8383
int skipped = 0;
8484
int errors = 0;
85-
var time = TimeSpan.Zero;
85+
var time = runConfiguration.EndTime - runConfiguration.StartTime;
8686

8787
var element = new XElement("assembly");
8888
XElement errorsElement = new XElement("errors");
@@ -95,7 +95,6 @@ orderby resultsByType.Key
9595
failed += collection.failed;
9696
skipped += collection.skipped;
9797
errors += collection.error;
98-
time += collection.time;
9998

10099
element.Add(collection.element);
101100
}

0 commit comments

Comments
 (0)