@@ -4,6 +4,7 @@ use crate::results::{BrokenReason, FailureReason, TestResult};
4
4
5
5
pub trait ResultName {
6
6
fn name ( & self ) -> String ;
7
+ fn long_name ( & self ) -> String ;
7
8
}
8
9
9
10
impl ResultName for FailureReason {
@@ -17,6 +18,16 @@ impl ResultName for FailureReason {
17
18
FailureReason :: DependsOn ( _) => "faulty deps" . into ( ) ,
18
19
}
19
20
}
21
+
22
+ fn long_name ( & self ) -> String {
23
+ match self {
24
+ FailureReason :: CompilerError ( _) | FailureReason :: DependsOn ( _) => self . to_string ( ) ,
25
+ FailureReason :: Unknown
26
+ | FailureReason :: Timeout
27
+ | FailureReason :: OOM
28
+ | FailureReason :: ICE => self . name ( ) ,
29
+ }
30
+ }
20
31
}
21
32
22
33
impl ResultName for BrokenReason {
@@ -28,6 +39,10 @@ impl ResultName for BrokenReason {
28
39
BrokenReason :: MissingGitRepository => "missing repo" . into ( ) ,
29
40
}
30
41
}
42
+
43
+ fn long_name ( & self ) -> String {
44
+ self . name ( )
45
+ }
31
46
}
32
47
33
48
impl ResultName for TestResult {
@@ -42,6 +57,18 @@ impl ResultName for TestResult {
42
57
TestResult :: Skipped => "skipped" . into ( ) ,
43
58
}
44
59
}
60
+
61
+ fn long_name ( & self ) -> String {
62
+ match self {
63
+ TestResult :: BuildFail ( reason) => format ! ( "build {}" , reason. long_name( ) ) ,
64
+ TestResult :: TestFail ( reason) => format ! ( "test {}" , reason. long_name( ) ) ,
65
+ TestResult :: BrokenCrate ( reason) => reason. long_name ( ) ,
66
+ TestResult :: TestSkipped
67
+ | TestResult :: TestPass
68
+ | TestResult :: Error
69
+ | TestResult :: Skipped => self . name ( ) ,
70
+ }
71
+ }
45
72
}
46
73
47
74
#[ derive( Serialize ) ]
0 commit comments