@@ -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 ( IterHeaderCallbackArgs < ' _ > ) ,
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.
@@ -811,28 +800,42 @@ struct IterHeaderCallbackArgs<'ln> {
811
800
line_number : usize ,
812
801
}
813
802
814
- fn iter_header_extra (
803
+ fn iter_header (
815
804
mode : Mode ,
816
805
suite : & str ,
817
806
poisoned : & mut bool ,
818
807
testfile : & Path ,
819
808
rdr : impl Read ,
820
- extra_directives : & [ & str ] ,
821
809
it : & mut dyn FnMut ( IterHeaderCallbackArgs < ' _ > ) ,
822
810
) {
823
811
if testfile. is_dir ( ) {
824
812
return ;
825
813
}
826
814
827
- // Process any extra directives supplied by the caller (e.g. because they
828
- // are implied by the test mode), with a dummy line number of 0.
829
- for directive in extra_directives {
830
- it ( IterHeaderCallbackArgs {
831
- header_revision : None ,
832
- original_line : directive,
833
- directive,
834
- line_number : 0 ,
835
- } ) ;
815
+ // Coverage tests in coverage-run mode always have these extra directives,
816
+ // without needing to specify them manually in every test file.
817
+ // (Some of the comments below have been copied over from the old
818
+ // `tests/run-make/coverage-reports/Makefile`, which no longer exists.)
819
+ if mode == Mode :: CoverageRun {
820
+ let extra_directives: & [ & str ] = & [
821
+ "needs-profiler-support" ,
822
+ // FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
823
+ // properly. Since we only have GCC on the CI ignore the test for now.
824
+ "ignore-windows-gnu" ,
825
+ // FIXME(pietroalbini): this test currently does not work on cross-compiled
826
+ // targets because remote-test is not capable of sending back the *.profraw
827
+ // files generated by the LLVM instrumentation.
828
+ "ignore-cross-compile" ,
829
+ ] ;
830
+ // Process the extra implied directives, with a dummy line number of 0.
831
+ for directive in extra_directives {
832
+ it ( IterHeaderCallbackArgs {
833
+ header_revision : None ,
834
+ original_line : "" ,
835
+ directive,
836
+ line_number : 0 ,
837
+ } ) ;
838
+ }
836
839
}
837
840
838
841
let comment = if testfile. extension ( ) . is_some_and ( |e| e == "rs" ) {
@@ -1164,35 +1167,14 @@ pub fn make_test_description<R: Read>(
1164
1167
let mut ignore_message = None ;
1165
1168
let mut should_fail = false ;
1166
1169
1167
- let extra_directives: & [ & str ] = match config. mode {
1168
- // The coverage-run tests are treated as having these extra directives,
1169
- // without needing to specify them manually in every test file.
1170
- // (Some of the comments below have been copied over from
1171
- // `tests/run-make/coverage-reports/Makefile`, which no longer exists.)
1172
- Mode :: CoverageRun => {
1173
- & [
1174
- "needs-profiler-support" ,
1175
- // FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works
1176
- // properly. Since we only have GCC on the CI ignore the test for now.
1177
- "ignore-windows-gnu" ,
1178
- // FIXME(pietroalbini): this test currently does not work on cross-compiled
1179
- // targets because remote-test is not capable of sending back the *.profraw
1180
- // files generated by the LLVM instrumentation.
1181
- "ignore-cross-compile" ,
1182
- ]
1183
- }
1184
- _ => & [ ] ,
1185
- } ;
1186
-
1187
1170
let mut local_poisoned = false ;
1188
1171
1189
- iter_header_extra (
1172
+ iter_header (
1190
1173
config. mode ,
1191
1174
& config. suite ,
1192
1175
& mut local_poisoned,
1193
1176
path,
1194
1177
src,
1195
- extra_directives,
1196
1178
& mut |IterHeaderCallbackArgs {
1197
1179
header_revision,
1198
1180
original_line,
0 commit comments