1
1
//! Various data structures used for carrying information about test success or failure
2
2
3
3
use crate :: { status_emitter:: TestStatus , AbortCheck , Error } ;
4
+ use bstr:: ByteSlice ;
4
5
use color_eyre:: eyre:: Result ;
5
6
6
7
/// The possible non-failure results a single test can have.
@@ -16,7 +17,6 @@ pub enum TestOk {
16
17
pub type TestResult = Result < TestOk , Errored > ;
17
18
18
19
/// Information about a test failure.
19
- #[ derive( Debug ) ]
20
20
pub struct Errored {
21
21
/// Command that failed
22
22
pub ( crate ) command : String ,
@@ -28,6 +28,16 @@ pub struct Errored {
28
28
pub ( crate ) stdout : Vec < u8 > ,
29
29
}
30
30
31
+ impl std:: fmt:: Debug for Errored {
32
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
33
+ writeln ! ( f, "command: {}" , self . command) ?;
34
+ writeln ! ( f, "errors: {:#?}" , self . errors) ?;
35
+ writeln ! ( f, "stderr: {}" , self . stderr. to_str_lossy( ) ) ?;
36
+ writeln ! ( f, "stdout: {}" , self . stdout. to_str_lossy( ) ) ?;
37
+ Ok ( ( ) )
38
+ }
39
+ }
40
+
31
41
impl Errored {
32
42
/// If no command was executed for this error, use a message instead.
33
43
pub fn new ( errors : Vec < Error > , message : & str ) -> Self {
0 commit comments