@@ -11,10 +11,10 @@ use tracing::*;
11
11
12
12
use crate :: common:: { Config , Debugger , FailMode , Mode , PassMode } ;
13
13
use crate :: debuggers:: { extract_cdb_version, extract_gdb_version} ;
14
+ use crate :: directives:: auxiliary:: { AuxProps , parse_and_update_aux} ;
15
+ use crate :: directives:: needs:: CachedNeedsConditions ;
14
16
use crate :: errors:: ErrorKind ;
15
17
use crate :: executor:: { CollectedTestDesc , ShouldPanic } ;
16
- use crate :: header:: auxiliary:: { AuxProps , parse_and_update_aux} ;
17
- use crate :: header:: needs:: CachedNeedsConditions ;
18
18
use crate :: help;
19
19
use crate :: util:: static_regex;
20
20
@@ -24,11 +24,11 @@ mod needs;
24
24
#[ cfg( test) ]
25
25
mod tests;
26
26
27
- pub struct HeadersCache {
27
+ pub struct DirectivesCache {
28
28
needs : CachedNeedsConditions ,
29
29
}
30
30
31
- impl HeadersCache {
31
+ impl DirectivesCache {
32
32
pub fn load ( config : & Config ) -> Self {
33
33
Self { needs : CachedNeedsConditions :: load ( config) }
34
34
}
@@ -54,7 +54,7 @@ impl EarlyProps {
54
54
pub fn from_reader < R : Read > ( config : & Config , testfile : & Utf8Path , rdr : R ) -> Self {
55
55
let mut props = EarlyProps :: default ( ) ;
56
56
let mut poisoned = false ;
57
- iter_header (
57
+ iter_directives (
58
58
config. mode ,
59
59
& config. suite ,
60
60
& mut poisoned,
@@ -138,12 +138,12 @@ pub struct TestProps {
138
138
pub incremental_dir : Option < Utf8PathBuf > ,
139
139
// If `true`, this test will use incremental compilation.
140
140
//
141
- // This can be set manually with the `incremental` header , or implicitly
141
+ // This can be set manually with the `incremental` directive , or implicitly
142
142
// by being a part of an incremental mode test. Using the `incremental`
143
- // header should be avoided if possible; using an incremental mode test is
143
+ // directive should be avoided if possible; using an incremental mode test is
144
144
// preferred. Incremental mode tests support multiple passes, which can
145
145
// verify that the incremental cache can be loaded properly after being
146
- // created. Just setting the header will only verify the behavior with
146
+ // created. Just setting the directive will only verify the behavior with
147
147
// creating an incremental cache, but doesn't check that it is created
148
148
// correctly.
149
149
//
@@ -347,7 +347,7 @@ impl TestProps {
347
347
348
348
let mut poisoned = false ;
349
349
350
- iter_header (
350
+ iter_directives (
351
351
config. mode ,
352
352
& config. suite ,
353
353
& mut poisoned,
@@ -642,11 +642,11 @@ impl TestProps {
642
642
let check_ui = |mode : & str | {
643
643
// Mode::Crashes may need build-fail in order to trigger llvm errors or stack overflows
644
644
if config. mode != Mode :: Ui && config. mode != Mode :: Crashes {
645
- panic ! ( "`{}-fail` header is only supported in UI tests" , mode) ;
645
+ panic ! ( "`{}-fail` directive is only supported in UI tests" , mode) ;
646
646
}
647
647
} ;
648
648
if config. mode == Mode :: Ui && config. parse_name_directive ( ln, "compile-fail" ) {
649
- panic ! ( "`compile-fail` header is useless in UI tests" ) ;
649
+ panic ! ( "`compile-fail` directive is useless in UI tests" ) ;
650
650
}
651
651
let fail_mode = if config. parse_name_directive ( ln, "check-fail" ) {
652
652
check_ui ( "check" ) ;
@@ -662,7 +662,7 @@ impl TestProps {
662
662
} ;
663
663
match ( self . fail_mode , fail_mode) {
664
664
( None , Some ( _) ) => self . fail_mode = fail_mode,
665
- ( Some ( _) , Some ( _) ) => panic ! ( "multiple `*-fail` headers in a single test" ) ,
665
+ ( Some ( _) , Some ( _) ) => panic ! ( "multiple `*-fail` directives in a single test" ) ,
666
666
( _, None ) => { }
667
667
}
668
668
}
@@ -674,10 +674,10 @@ impl TestProps {
674
674
( Mode :: Codegen , "build-pass" ) => ( ) ,
675
675
( Mode :: Incremental , _) => {
676
676
if revision. is_some ( ) && !self . revisions . iter ( ) . all ( |r| r. starts_with ( "cfail" ) ) {
677
- panic ! ( "`{s}` header is only supported in `cfail` incremental tests" )
677
+ panic ! ( "`{s}` directive is only supported in `cfail` incremental tests" )
678
678
}
679
679
}
680
- ( mode, _) => panic ! ( "`{s}` header is not supported in `{mode}` tests" ) ,
680
+ ( mode, _) => panic ! ( "`{s}` directive is not supported in `{mode}` tests" ) ,
681
681
} ;
682
682
let pass_mode = if config. parse_name_directive ( ln, "check-pass" ) {
683
683
check_no_run ( "check-pass" ) ;
@@ -693,7 +693,7 @@ impl TestProps {
693
693
} ;
694
694
match ( self . pass_mode , pass_mode) {
695
695
( None , Some ( _) ) => self . pass_mode = pass_mode,
696
- ( Some ( _) , Some ( _) ) => panic ! ( "multiple `*-pass` headers in a single test" ) ,
696
+ ( Some ( _) , Some ( _) ) => panic ! ( "multiple `*-pass` directives in a single test" ) ,
697
697
( _, None ) => { }
698
698
}
699
699
}
@@ -794,7 +794,7 @@ const KNOWN_JSONDOCCK_DIRECTIVE_NAMES: &[&str] =
794
794
& [ "count" , "!count" , "has" , "!has" , "is" , "!is" , "ismany" , "!ismany" , "set" , "!set" ] ;
795
795
796
796
/// The (partly) broken-down contents of a line containing a test directive,
797
- /// which [`iter_header `] passes to its callback function.
797
+ /// which [`iter_directives `] passes to its callback function.
798
798
///
799
799
/// For example:
800
800
///
@@ -867,7 +867,7 @@ pub(crate) fn check_directive<'a>(
867
867
868
868
const COMPILETEST_DIRECTIVE_PREFIX : & str = "//@" ;
869
869
870
- fn iter_header (
870
+ fn iter_directives (
871
871
mode : Mode ,
872
872
_suite : & str ,
873
873
poisoned : & mut bool ,
@@ -1163,8 +1163,7 @@ enum NormalizeKind {
1163
1163
Stderr64bit ,
1164
1164
}
1165
1165
1166
- /// Parses the regex and replacement values of a `//@ normalize-*` header,
1167
- /// in the format:
1166
+ /// Parses the regex and replacement values of a `//@ normalize-*` directive, in the format:
1168
1167
/// ```text
1169
1168
/// "REGEX" -> "REPLACEMENT"
1170
1169
/// ```
@@ -1373,7 +1372,7 @@ where
1373
1372
1374
1373
pub ( crate ) fn make_test_description < R : Read > (
1375
1374
config : & Config ,
1376
- cache : & HeadersCache ,
1375
+ cache : & DirectivesCache ,
1377
1376
name : String ,
1378
1377
path : & Utf8Path ,
1379
1378
src : R ,
@@ -1387,7 +1386,7 @@ pub(crate) fn make_test_description<R: Read>(
1387
1386
let mut local_poisoned = false ;
1388
1387
1389
1388
// Scan through the test file to handle `ignore-*`, `only-*`, and `needs-*` directives.
1390
- iter_header (
1389
+ iter_directives (
1391
1390
config. mode ,
1392
1391
& config. suite ,
1393
1392
& mut local_poisoned,
0 commit comments