44use crate :: { serialize:: serialize_report, SerializeError } ;
55use chrono:: { DateTime , FixedOffset } ;
66use indexmap:: map:: IndexMap ;
7+ #[ cfg( feature = "uuids" ) ]
78use newtype_uuid:: { GenericUuid , TypedUuid , TypedUuidKind , TypedUuidTag } ;
89use std:: { borrow:: Borrow , hash:: Hash , io, iter, ops:: Deref , time:: Duration } ;
10+ #[ cfg( feature = "uuids" ) ]
911use uuid:: Uuid ;
1012
1113/// A tag indicating the kind of report.
14+ #[ cfg( feature = "uuids" ) ]
1215pub enum ReportKind { }
1316
17+ #[ cfg( feature = "uuids" ) ]
1418impl TypedUuidKind for ReportKind {
1519 fn tag ( ) -> TypedUuidTag {
1620 const TAG : TypedUuidTag = TypedUuidTag :: new ( "quick-junit-report" ) ;
@@ -19,6 +23,7 @@ impl TypedUuidKind for ReportKind {
1923}
2024
2125/// A unique identifier associated with a report.
26+ #[ cfg( feature = "uuids" ) ]
2227pub type ReportUuid = TypedUuid < ReportKind > ;
2328
2429/// The root element of a JUnit report.
@@ -30,6 +35,7 @@ pub struct Report {
3035 /// A unique identifier associated with this report.
3136 ///
3237 /// This is an extension to the spec that's used by nextest.
38+ #[ cfg( feature = "uuids" ) ]
3339 pub uuid : Option < ReportUuid > ,
3440
3541 /// The time at which the first test in this report began execution.
@@ -60,6 +66,7 @@ impl Report {
6066 pub fn new ( name : impl Into < XmlString > ) -> Self {
6167 Self {
6268 name : name. into ( ) ,
69+ #[ cfg( feature = "uuids" ) ]
6370 uuid : None ,
6471 timestamp : None ,
6572 time : None ,
@@ -73,6 +80,7 @@ impl Report {
7380 /// Sets a unique ID for this `Report`.
7481 ///
7582 /// This is an extension that's used by nextest.
83+ #[ cfg( feature = "uuids" ) ]
7684 pub fn set_report_uuid ( & mut self , uuid : ReportUuid ) -> & mut Self {
7785 self . uuid = Some ( uuid) ;
7886 self
@@ -81,6 +89,7 @@ impl Report {
8189 /// Sets a unique ID for this `Report` from an untyped [`Uuid`].
8290 ///
8391 /// This is an extension that's used by nextest.
92+ #[ cfg( feature = "uuids" ) ]
8493 pub fn set_uuid ( & mut self , uuid : Uuid ) -> & mut Self {
8594 self . uuid = Some ( ReportUuid :: from_untyped_uuid ( uuid) ) ;
8695 self
0 commit comments