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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Report
impl RefUnwindSafe for Report
impl Send for Report
impl Sync for Report
impl Unpin for Report
impl UnwindSafe for Report
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)