@@ -671,17 +671,6 @@ pub fn line_directive<'line>(
671
671
}
672
672
}
673
673
674
- fn iter_header < R : Read > (
675
- mode : Mode ,
676
- suite : & str ,
677
- poisoned : & mut bool ,
678
- testfile : & Path ,
679
- rdr : R ,
680
- it : & mut dyn FnMut ( HeaderLine < ' _ > ) ,
681
- ) {
682
- iter_header_extra ( mode, suite, poisoned, testfile, rdr, & [ ] , it)
683
- }
684
-
685
674
/// This is generated by collecting directives from ui tests and then extracting their directive
686
675
/// names. This is **not** an exhaustive list of all possible directives. Instead, this is a
687
676
/// best-effort approximation for diagnostics.
@@ -812,23 +801,37 @@ struct HeaderLine<'ln> {
812
801
line_number : usize ,
813
802
}
814
803
815
- fn iter_header_extra (
804
+ fn iter_header (
816
805
mode : Mode ,
817
806
suite : & str ,
818
807
poisoned : & mut bool ,
819
808
testfile : & Path ,
820
809
rdr : impl Read ,
821
- extra_directives : & [ & str ] ,
822
810
it : & mut dyn FnMut ( HeaderLine < ' _ > ) ,
823
811
) {
824
812
if testfile. is_dir ( ) {
825
813
return ;
826
814
}
827
815
828
- // Process any extra directives supplied by the caller (e.g. because they
829
- // are implied by the test mode), with a dummy line number of 0.
830
- for directive in extra_directives {
831
- it ( HeaderLine { header_revision : None , original_line : "" , directive, line_number : 0 } ) ;
816
+ // Coverage tests in coverage-run mode always have these extra directives,
817
+ // without needing to specify them manually in every test file.
818
+ // (Some of the comments below have been copied over from the old
819
+ // `tests/run-make/coverage-reports/Makefile`, which no longer exists.)
820
+ if mode == Mode :: CoverageRun {
821
+ let extra_directives: & [ & str ] = & [
822
+ "needs-profiler-support" ,
823
+ // FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
824
+ // properly. Since we only have GCC on the CI ignore the test for now.
825
+ "ignore-windows-gnu" ,
826
+ // FIXME(pietroalbini): this test currently does not work on cross-compiled
827
+ // targets because remote-test is not capable of sending back the *.profraw
828
+ // files generated by the LLVM instrumentation.
829
+ "ignore-cross-compile" ,
830
+ ] ;
831
+ // Process the extra implied directives, with a dummy line number of 0.
832
+ for directive in extra_directives {
833
+ it ( HeaderLine { header_revision : None , original_line : "" , directive, line_number : 0 } ) ;
834
+ }
832
835
}
833
836
834
837
let comment = if testfile. extension ( ) . is_some_and ( |e| e == "rs" ) {
@@ -1160,35 +1163,14 @@ pub fn make_test_description<R: Read>(
1160
1163
let mut ignore_message = None ;
1161
1164
let mut should_fail = false ;
1162
1165
1163
- let extra_directives: & [ & str ] = match config. mode {
1164
- // The coverage-run tests are treated as having these extra directives,
1165
- // without needing to specify them manually in every test file.
1166
- // (Some of the comments below have been copied over from
1167
- // `tests/run-make/coverage-reports/Makefile`, which no longer exists.)
1168
- Mode :: CoverageRun => {
1169
- & [
1170
- "needs-profiler-support" ,
1171
- // FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
1172
- // properly. Since we only have GCC on the CI ignore the test for now.
1173
- "ignore-windows-gnu" ,
1174
- // FIXME(pietroalbini): this test currently does not work on cross-compiled
1175
- // targets because remote-test is not capable of sending back the *.profraw
1176
- // files generated by the LLVM instrumentation.
1177
- "ignore-cross-compile" ,
1178
- ]
1179
- }
1180
- _ => & [ ] ,
1181
- } ;
1182
-
1183
1166
let mut local_poisoned = false ;
1184
1167
1185
- iter_header_extra (
1168
+ iter_header (
1186
1169
config. mode ,
1187
1170
& config. suite ,
1188
1171
& mut local_poisoned,
1189
1172
path,
1190
1173
src,
1191
- extra_directives,
1192
1174
& mut |HeaderLine { header_revision, original_line, directive : ln, line_number } | {
1193
1175
if header_revision. is_some ( ) && header_revision != cfg {
1194
1176
return ;
0 commit comments