@@ -70,6 +70,12 @@ pub fn parse_config(args: Vec<String>) -> Config {
7070 "compile-fail | run-fail | run-pass-valgrind | pretty | debug-info | codegen | rustdoc \
7171 codegen-units | incremental | run-make | ui | js-doc-test | mir-opt | assembly",
7272 )
73+ . reqopt (
74+ "" ,
75+ "suite" ,
76+ "which suite of compile tests to run. used for nicer error reporting." ,
77+ "SUITE" ,
78+ )
7379 . optopt (
7480 "" ,
7581 "pass" ,
@@ -201,6 +207,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
201207 build_base : opt_path ( matches, "build-base" ) ,
202208 stage_id : matches. opt_str ( "stage-id" ) . unwrap ( ) ,
203209 mode : matches. opt_str ( "mode" ) . unwrap ( ) . parse ( ) . expect ( "invalid mode" ) ,
210+ suite : matches. opt_str ( "suite" ) . unwrap ( ) ,
204211 debugger : None ,
205212 run_ignored,
206213 filter : matches. free . first ( ) . cloned ( ) ,
@@ -340,7 +347,7 @@ pub fn run_tests(config: Config) {
340347 configs. extend ( configure_lldb ( & config) ) ;
341348 }
342349 } else {
343- configs. push ( config) ;
350+ configs. push ( config. clone ( ) ) ;
344351 } ;
345352
346353 let mut tests = Vec :: new ( ) ;
@@ -351,11 +358,32 @@ pub fn run_tests(config: Config) {
351358 let res = test:: run_tests_console ( & opts, tests) ;
352359 match res {
353360 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+ }
355380 Err ( e) => {
356381 // We don't know if tests passed or not, but if there was an error
357382 // during testing we don't want to just suceeed (we may not have
358383 // tested something), so fail.
384+ //
385+ // This should realistically "never" happen, so don't try to make
386+ // this a pretty error message.
359387 panic ! ( "I/O failure during tests: {:?}" , e) ;
360388 }
361389 }
0 commit comments