@@ -555,6 +555,8 @@ pub fn make_tests(
555555 let modified_tests = modified_tests ( & config, & config. src_base ) . unwrap_or_else ( |err| {
556556 panic ! ( "modified_tests got error from dir: {}, error: {}" , config. src_base. display( ) , err)
557557 } ) ;
558+
559+ let mut poisoned = false ;
558560 collect_tests_from_dir (
559561 config. clone ( ) ,
560562 & config. src_base ,
@@ -563,8 +565,14 @@ pub fn make_tests(
563565 tests,
564566 found_paths,
565567 & modified_tests,
568+ & mut poisoned,
566569 )
567570 . unwrap_or_else ( |_| panic ! ( "Could not read tests from {}" , config. src_base. display( ) ) ) ;
571+
572+ if poisoned {
573+ eprintln ! ( ) ;
574+ panic ! ( "there are errors in tests" ) ;
575+ }
568576}
569577
570578/// Returns a stamp constructed from input files common to all test cases.
@@ -634,6 +642,7 @@ fn collect_tests_from_dir(
634642 tests : & mut Vec < test:: TestDescAndFn > ,
635643 found_paths : & mut BTreeSet < PathBuf > ,
636644 modified_tests : & Vec < PathBuf > ,
645+ poisoned : & mut bool ,
637646) -> io:: Result < ( ) > {
638647 // Ignore directories that contain a file named `compiletest-ignore-dir`.
639648 if dir. join ( "compiletest-ignore-dir" ) . exists ( ) {
@@ -645,7 +654,7 @@ fn collect_tests_from_dir(
645654 file : dir. to_path_buf ( ) ,
646655 relative_dir : relative_dir_path. parent ( ) . unwrap ( ) . to_path_buf ( ) ,
647656 } ;
648- tests. extend ( make_test ( config, & paths, inputs) ) ;
657+ tests. extend ( make_test ( config, & paths, inputs, poisoned ) ) ;
649658 return Ok ( ( ) ) ;
650659 }
651660
@@ -671,7 +680,7 @@ fn collect_tests_from_dir(
671680 let paths =
672681 TestPaths { file : file_path, relative_dir : relative_dir_path. to_path_buf ( ) } ;
673682
674- tests. extend ( make_test ( config. clone ( ) , & paths, inputs) )
683+ tests. extend ( make_test ( config. clone ( ) , & paths, inputs, poisoned ) )
675684 } else if file_path. is_dir ( ) {
676685 let relative_file_path = relative_dir_path. join ( file. file_name ( ) ) ;
677686 if & file_name != "auxiliary" {
@@ -684,6 +693,7 @@ fn collect_tests_from_dir(
684693 tests,
685694 found_paths,
686695 modified_tests,
696+ poisoned,
687697 ) ?;
688698 }
689699 } else {
@@ -710,6 +720,7 @@ fn make_test(
710720 config : Arc < Config > ,
711721 testpaths : & TestPaths ,
712722 inputs : & Stamp ,
723+ poisoned : & mut bool ,
713724) -> Vec < test:: TestDescAndFn > {
714725 let test_path = if config. mode == Mode :: RunMake {
715726 // Parse directives in the Makefile
@@ -726,14 +737,16 @@ fn make_test(
726737 } else {
727738 early_props. revisions . iter ( ) . map ( Some ) . collect ( )
728739 } ;
740+
729741 revisions
730742 . into_iter ( )
731743 . map ( |revision| {
732744 let src_file =
733745 std:: fs:: File :: open ( & test_path) . expect ( "open test file to parse ignores" ) ;
734746 let cfg = revision. map ( |v| & * * v) ;
735747 let test_name = crate :: make_test_name ( & config, testpaths, revision) ;
736- let mut desc = make_test_description ( & config, test_name, & test_path, src_file, cfg) ;
748+ let mut desc =
749+ make_test_description ( & config, test_name, & test_path, src_file, cfg, poisoned) ;
737750 // Ignore tests that already run and are up to date with respect to inputs.
738751 if !config. force_rerun {
739752 desc. ignore |= is_up_to_date (
0 commit comments