@@ -2,13 +2,13 @@ use colored::*;
2
2
use regex:: Regex ;
3
3
use std:: env;
4
4
use std:: path:: PathBuf ;
5
- use ui_test:: { Config , Mode , OutputConflictHandling } ;
5
+ use ui_test:: { Config , Mode , OutputConflictHandling , color_eyre :: Result } ;
6
6
7
7
fn miri_path ( ) -> PathBuf {
8
8
PathBuf :: from ( option_env ! ( "MIRI" ) . unwrap_or ( env ! ( "CARGO_BIN_EXE_miri" ) ) )
9
9
}
10
10
11
- fn run_tests ( mode : Mode , path : & str , target : Option < String > ) {
11
+ fn run_tests ( mode : Mode , path : & str , target : Option < String > ) -> Result < ( ) > {
12
12
let in_rustc_test_suite = option_env ! ( "RUSTC_STAGE" ) . is_some ( ) ;
13
13
14
14
// Add some flags we always want.
@@ -108,7 +108,7 @@ regexes! {
108
108
"sys/[a-z]+/" => "sys/PLATFORM/" ,
109
109
}
110
110
111
- fn ui ( mode : Mode , path : & str ) {
111
+ fn ui ( mode : Mode , path : & str ) -> Result < ( ) > {
112
112
let target = get_target ( ) ;
113
113
114
114
let msg = format ! (
@@ -117,20 +117,24 @@ fn ui(mode: Mode, path: &str) {
117
117
) ;
118
118
eprintln ! ( "{}" , msg. green( ) . bold( ) ) ;
119
119
120
- run_tests ( mode, path, target) ;
120
+ run_tests ( mode, path, target)
121
121
}
122
122
123
123
fn get_target ( ) -> Option < String > {
124
124
env:: var ( "MIRI_TEST_TARGET" ) . ok ( )
125
125
}
126
126
127
- fn main ( ) {
127
+ fn main ( ) -> Result < ( ) > {
128
+ ui_test:: color_eyre:: install ( ) ?;
129
+
128
130
// Add a test env var to do environment communication tests.
129
131
env:: set_var ( "MIRI_ENV_VAR_TEST" , "0" ) ;
130
132
// Let the tests know where to store temp files (they might run for a different target, which can make this hard to find).
131
133
env:: set_var ( "MIRI_TEMP" , env:: temp_dir ( ) ) ;
132
134
133
- ui ( Mode :: Pass , "tests/pass" ) ;
134
- ui ( Mode :: Panic , "tests/panic" ) ;
135
- ui ( Mode :: Fail , "tests/fail" ) ;
135
+ ui ( Mode :: Pass , "tests/pass" ) ?;
136
+ ui ( Mode :: Panic , "tests/panic" ) ?;
137
+ ui ( Mode :: Fail , "tests/fail" ) ?;
138
+
139
+ Ok ( ( ) )
136
140
}
0 commit comments