4
4
use crate :: { serialize:: serialize_report, SerializeError } ;
5
5
use chrono:: { DateTime , FixedOffset } ;
6
6
use indexmap:: map:: IndexMap ;
7
+ #[ cfg( feature = "uuids" ) ]
7
8
use newtype_uuid:: { GenericUuid , TypedUuid , TypedUuidKind , TypedUuidTag } ;
8
9
use std:: { borrow:: Borrow , hash:: Hash , io, iter, ops:: Deref , time:: Duration } ;
10
+ #[ cfg( feature = "uuids" ) ]
9
11
use uuid:: Uuid ;
10
12
11
13
/// A tag indicating the kind of report.
14
+ #[ cfg( feature = "uuids" ) ]
12
15
pub enum ReportKind { }
13
16
17
+ #[ cfg( feature = "uuids" ) ]
14
18
impl TypedUuidKind for ReportKind {
15
19
fn tag ( ) -> TypedUuidTag {
16
20
const TAG : TypedUuidTag = TypedUuidTag :: new ( "quick-junit-report" ) ;
@@ -19,6 +23,7 @@ impl TypedUuidKind for ReportKind {
19
23
}
20
24
21
25
/// A unique identifier associated with a report.
26
+ #[ cfg( feature = "uuids" ) ]
22
27
pub type ReportUuid = TypedUuid < ReportKind > ;
23
28
24
29
/// The root element of a JUnit report.
@@ -30,6 +35,7 @@ pub struct Report {
30
35
/// A unique identifier associated with this report.
31
36
///
32
37
/// This is an extension to the spec that's used by nextest.
38
+ #[ cfg( feature = "uuids" ) ]
33
39
pub uuid : Option < ReportUuid > ,
34
40
35
41
/// The time at which the first test in this report began execution.
@@ -60,6 +66,7 @@ impl Report {
60
66
pub fn new ( name : impl Into < XmlString > ) -> Self {
61
67
Self {
62
68
name : name. into ( ) ,
69
+ #[ cfg( feature = "uuids" ) ]
63
70
uuid : None ,
64
71
timestamp : None ,
65
72
time : None ,
@@ -73,6 +80,7 @@ impl Report {
73
80
/// Sets a unique ID for this `Report`.
74
81
///
75
82
/// This is an extension that's used by nextest.
83
+ #[ cfg( feature = "uuids" ) ]
76
84
pub fn set_report_uuid ( & mut self , uuid : ReportUuid ) -> & mut Self {
77
85
self . uuid = Some ( uuid) ;
78
86
self
@@ -81,6 +89,7 @@ impl Report {
81
89
/// Sets a unique ID for this `Report` from an untyped [`Uuid`].
82
90
///
83
91
/// This is an extension that's used by nextest.
92
+ #[ cfg( feature = "uuids" ) ]
84
93
pub fn set_uuid ( & mut self , uuid : Uuid ) -> & mut Self {
85
94
self . uuid = Some ( ReportUuid :: from_untyped_uuid ( uuid) ) ;
86
95
self
0 commit comments