pub struct Report {
pub name: XmlString,
pub uuid: Option<ReportUuid>,
pub timestamp: Option<DateTime<FixedOffset>>,
pub time: Option<Duration>,
pub tests: usize,
pub failures: usize,
pub errors: usize,
pub test_suites: Vec<TestSuite>,
}
Expand description
The root element of a JUnit report.
Fields§
§name: XmlString
The name of this report.
uuid: Option<ReportUuid>
A unique identifier associated with this report.
This is an extension to the spec that’s used by nextest.
timestamp: Option<DateTime<FixedOffset>>
The time at which the first test in this report began execution.
This is not part of the JUnit spec, but may be useful for some tools.
time: Option<Duration>
The overall time taken by the test suite.
This is serialized as the number of seconds.
tests: usize
The total number of tests from all TestSuites.
failures: usize
The total number of failures from all TestSuites.
errors: usize
The total number of errors from all TestSuites.
test_suites: Vec<TestSuite>
The test suites contained in this report.
Implementations§
Source§impl Report
impl Report
Sourcepub fn set_report_uuid(&mut self, uuid: ReportUuid) -> &mut Self
pub fn set_report_uuid(&mut self, uuid: ReportUuid) -> &mut Self
Sets a unique ID for this Report
.
This is an extension that’s used by nextest.
Sourcepub fn set_uuid(&mut self, uuid: Uuid) -> &mut Self
pub fn set_uuid(&mut self, uuid: Uuid) -> &mut Self
Sets a unique ID for this Report
from an untyped Uuid
.
This is an extension that’s used by nextest.
Sourcepub fn set_timestamp(
&mut self,
timestamp: impl Into<DateTime<FixedOffset>>,
) -> &mut Self
pub fn set_timestamp( &mut self, timestamp: impl Into<DateTime<FixedOffset>>, ) -> &mut Self
Sets the start timestamp for the report.
Sourcepub fn set_time(&mut self, time: Duration) -> &mut Self
pub fn set_time(&mut self, time: Duration) -> &mut Self
Sets the time taken for overall execution.
Sourcepub fn add_test_suite(&mut self, test_suite: TestSuite) -> &mut Self
pub fn add_test_suite(&mut self, test_suite: TestSuite) -> &mut Self
Adds a new TestSuite and updates the tests
, failures
and errors
counts.
When generating a new report, use of this method is recommended over adding to
self.TestSuites
directly.
Sourcepub fn add_test_suites(
&mut self,
test_suites: impl IntoIterator<Item = TestSuite>,
) -> &mut Self
pub fn add_test_suites( &mut self, test_suites: impl IntoIterator<Item = TestSuite>, ) -> &mut Self
Adds several TestSuite
s and updates the tests
, failures
and errors
counts.
When generating a new report, use of this method is recommended over adding to
self.TestSuites
directly.
Sourcepub fn serialize(&self, writer: impl Write) -> Result<(), SerializeError>
pub fn serialize(&self, writer: impl Write) -> Result<(), SerializeError>
Serialize this report to the given writer.
Sourcepub fn to_string(&self) -> Result<String, SerializeError>
pub fn to_string(&self) -> Result<String, SerializeError>
Serialize this report to a string.