@@ -555,6 +555,8 @@ pub fn make_tests(
555
555
let modified_tests = modified_tests ( & config, & config. src_base ) . unwrap_or_else ( |err| {
556
556
panic ! ( "modified_tests got error from dir: {}, error: {}" , config. src_base. display( ) , err)
557
557
} ) ;
558
+
559
+ let mut poisoned = false ;
558
560
collect_tests_from_dir (
559
561
config. clone ( ) ,
560
562
& config. src_base ,
@@ -563,8 +565,14 @@ pub fn make_tests(
563
565
tests,
564
566
found_paths,
565
567
& modified_tests,
568
+ & mut poisoned,
566
569
)
567
570
. 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
+ }
568
576
}
569
577
570
578
/// Returns a stamp constructed from input files common to all test cases.
@@ -634,6 +642,7 @@ fn collect_tests_from_dir(
634
642
tests : & mut Vec < test:: TestDescAndFn > ,
635
643
found_paths : & mut BTreeSet < PathBuf > ,
636
644
modified_tests : & Vec < PathBuf > ,
645
+ poisoned : & mut bool ,
637
646
) -> io:: Result < ( ) > {
638
647
// Ignore directories that contain a file named `compiletest-ignore-dir`.
639
648
if dir. join ( "compiletest-ignore-dir" ) . exists ( ) {
@@ -645,7 +654,7 @@ fn collect_tests_from_dir(
645
654
file : dir. to_path_buf ( ) ,
646
655
relative_dir : relative_dir_path. parent ( ) . unwrap ( ) . to_path_buf ( ) ,
647
656
} ;
648
- tests. extend ( make_test ( config, & paths, inputs) ) ;
657
+ tests. extend ( make_test ( config, & paths, inputs, poisoned ) ) ;
649
658
return Ok ( ( ) ) ;
650
659
}
651
660
@@ -671,7 +680,7 @@ fn collect_tests_from_dir(
671
680
let paths =
672
681
TestPaths { file : file_path, relative_dir : relative_dir_path. to_path_buf ( ) } ;
673
682
674
- tests. extend ( make_test ( config. clone ( ) , & paths, inputs) )
683
+ tests. extend ( make_test ( config. clone ( ) , & paths, inputs, poisoned ) )
675
684
} else if file_path. is_dir ( ) {
676
685
let relative_file_path = relative_dir_path. join ( file. file_name ( ) ) ;
677
686
if & file_name != "auxiliary" {
@@ -684,6 +693,7 @@ fn collect_tests_from_dir(
684
693
tests,
685
694
found_paths,
686
695
modified_tests,
696
+ poisoned,
687
697
) ?;
688
698
}
689
699
} else {
@@ -710,6 +720,7 @@ fn make_test(
710
720
config : Arc < Config > ,
711
721
testpaths : & TestPaths ,
712
722
inputs : & Stamp ,
723
+ poisoned : & mut bool ,
713
724
) -> Vec < test:: TestDescAndFn > {
714
725
let test_path = if config. mode == Mode :: RunMake {
715
726
// Parse directives in the Makefile
@@ -726,14 +737,16 @@ fn make_test(
726
737
} else {
727
738
early_props. revisions . iter ( ) . map ( Some ) . collect ( )
728
739
} ;
740
+
729
741
revisions
730
742
. into_iter ( )
731
743
. map ( |revision| {
732
744
let src_file =
733
745
std:: fs:: File :: open ( & test_path) . expect ( "open test file to parse ignores" ) ;
734
746
let cfg = revision. map ( |v| & * * v) ;
735
747
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) ;
737
750
// Ignore tests that already run and are up to date with respect to inputs.
738
751
if !config. force_rerun {
739
752
desc. ignore |= is_up_to_date (
0 commit comments