@@ -70,6 +70,12 @@ pub fn parse_config(args: Vec<String>) -> Config {
70
70
"compile-fail | run-fail | run-pass-valgrind | pretty | debug-info | codegen | rustdoc \
71
71
codegen-units | incremental | run-make | ui | js-doc-test | mir-opt | assembly",
72
72
)
73
+ . reqopt (
74
+ "" ,
75
+ "suite" ,
76
+ "which suite of compile tests to run. used for nicer error reporting." ,
77
+ "SUITE" ,
78
+ )
73
79
. optopt (
74
80
"" ,
75
81
"pass" ,
@@ -201,6 +207,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
201
207
build_base : opt_path ( matches, "build-base" ) ,
202
208
stage_id : matches. opt_str ( "stage-id" ) . unwrap ( ) ,
203
209
mode : matches. opt_str ( "mode" ) . unwrap ( ) . parse ( ) . expect ( "invalid mode" ) ,
210
+ suite : matches. opt_str ( "suite" ) . unwrap ( ) ,
204
211
debugger : None ,
205
212
run_ignored,
206
213
filter : matches. free . first ( ) . cloned ( ) ,
@@ -340,7 +347,7 @@ pub fn run_tests(config: Config) {
340
347
configs. extend ( configure_lldb ( & config) ) ;
341
348
}
342
349
} else {
343
- configs. push ( config) ;
350
+ configs. push ( config. clone ( ) ) ;
344
351
} ;
345
352
346
353
let mut tests = Vec :: new ( ) ;
@@ -351,11 +358,32 @@ pub fn run_tests(config: Config) {
351
358
let res = test:: run_tests_console ( & opts, tests) ;
352
359
match res {
353
360
Ok ( true ) => { }
354
- Ok ( false ) => panic ! ( "Some tests failed" ) ,
361
+ Ok ( false ) => {
362
+ // We want to report that the tests failed, but we also want to give
363
+ // some indication of just what tests we were running. Especially on
364
+ // CI, where there can be cross-compiled tests for a lot of
365
+ // architectures, without this critical information it can be quite
366
+ // easy to miss which tests failed, and as such fail to reproduce
367
+ // the failure locally.
368
+
369
+ eprintln ! (
370
+ "Some tests failed in compiletest suite={}{} mode={} host={} target={}" ,
371
+ config. suite,
372
+ config. compare_mode. map( |c| format!( " compare_mode={:?}" , c) ) . unwrap_or_default( ) ,
373
+ config. mode,
374
+ config. host,
375
+ config. target
376
+ ) ;
377
+
378
+ std:: process:: exit ( 1 ) ;
379
+ }
355
380
Err ( e) => {
356
381
// We don't know if tests passed or not, but if there was an error
357
382
// during testing we don't want to just suceeed (we may not have
358
383
// tested something), so fail.
384
+ //
385
+ // This should realistically "never" happen, so don't try to make
386
+ // this a pretty error message.
359
387
panic ! ( "I/O failure during tests: {:?}" , e) ;
360
388
}
361
389
}
0 commit comments