Skip to content

Commit 28788f2

Browse files
committed
Remove the -test suffix from normalize directives
1 parent 3dba041 commit 28788f2

File tree

238 files changed

+447
-444
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

238 files changed

+447
-444
lines changed

src/tools/compiletest/src/directive-list.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
160160
"needs-xray",
161161
"no-auto-check-cfg",
162162
"no-prefer-dynamic",
163+
"normalize-stderr",
163164
"normalize-stderr-32bit",
164165
"normalize-stderr-64bit",
165-
"normalize-stderr-test",
166-
"normalize-stdout-test",
166+
"normalize-stdout",
167167
"only-16bit",
168168
"only-32bit",
169169
"only-64bit",

src/tools/compiletest/src/header.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -979,16 +979,20 @@ impl Config {
979979
}
980980

981981
fn parse_custom_normalization(&self, line: &str) -> Option<NormalizeRule> {
982-
let directive_name = line.split_once(':')?.0;
982+
// FIXME(Zalathar): Integrate name/value splitting into `DirectiveLine`
983+
// instead of doing it here.
984+
let (directive_name, _value) = line.split_once(':')?;
983985

984986
let kind = match directive_name {
985-
"normalize-stdout-test" => NormalizeKind::Stdout,
986-
"normalize-stderr-test" => NormalizeKind::Stderr,
987+
"normalize-stdout" => NormalizeKind::Stdout,
988+
"normalize-stderr" => NormalizeKind::Stderr,
987989
"normalize-stderr-32bit" => NormalizeKind::Stderr32bit,
988990
"normalize-stderr-64bit" => NormalizeKind::Stderr64bit,
989991
_ => return None,
990992
};
991993

994+
// FIXME(Zalathar): The normalize rule parser should only care about
995+
// the value part, not the "line" (which isn't even the whole line).
992996
let Some((regex, replacement)) = parse_normalize_rule(line) else {
993997
panic!(
994998
"couldn't parse custom normalization rule: `{line}`\n\

src/tools/tidy/src/style.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ const ANNOTATIONS_TO_IGNORE: &[&str] = &[
6969
"// gdb",
7070
"// lldb",
7171
"// cdb",
72-
"// normalize-stderr-test",
73-
"//@ normalize-stderr-test",
72+
"//@ normalize-stderr",
7473
];
7574

7675
fn generate_problems<'a>(
@@ -198,8 +197,8 @@ fn should_ignore(line: &str) -> bool {
198197

199198
// For `ui_test`-style UI test directives, also ignore
200199
// - `//@[rev] compile-flags`
201-
// - `//@[rev] normalize-stderr-test`
202-
|| static_regex!("\\s*//@(\\[.*\\]) (compile-flags|normalize-stderr-test|error-pattern).*")
200+
// - `//@[rev] normalize-stderr`
201+
|| static_regex!("\\s*//@(\\[.*\\]) (compile-flags|normalize-stderr|error-pattern).*")
203202
.is_match(line)
204203
// Matching for rustdoc tests commands.
205204
// It allows to prevent them emitting warnings like `line longer than 100 chars`.

tests/rustdoc-ui/2024-doctests-checks.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//@ check-pass
22
//@ edition: 2024
33
//@ compile-flags: --test --test-args=--test-threads=1
4-
//@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
5-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
6-
//@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
4+
//@ normalize-stdout: "tests/rustdoc-ui" -> "$$DIR"
5+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
6+
//@ normalize-stdout: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
77

88
/// ```
99
/// let x = 12;

tests/rustdoc-ui/2024-doctests-crate-attribute.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//@ check-pass
22
//@ edition: 2024
33
//@ compile-flags: --test --test-args=--test-threads=1
4-
//@ normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
5-
//@ normalize-stdout-test: "finished in \d+\.\d+s" -> "finished in $$TIME"
6-
//@ normalize-stdout-test: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
4+
//@ normalize-stdout: "tests/rustdoc-ui" -> "$$DIR"
5+
//@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME"
6+
//@ normalize-stdout: ".rs:\d+:\d+" -> ".rs:$$LINE:$$COL"
77

88
/// This doctest is used to ensure that if a crate attribute is present,
99
/// it will not be part of the merged doctests.

tests/rustdoc-ui/argfile/commandline-argfile-missing-windows.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// line arguments and is only run on windows.
66
//
77
//@ only-windows
8-
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
9-
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
8+
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
9+
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
1010
//@ compile-flags: --cfg cmdline_set @{{src-base}}\argfile\commandline-argfile-missing.args
1111

1212
#[cfg(not(cmdline_set))]

tests/rustdoc-ui/argfile/commandline-argfile-missing.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// windows.
77
//
88
//@ ignore-windows
9-
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
10-
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
9+
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
10+
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
1111
//@ compile-flags: --cfg cmdline_set @{{src-base}}/argfile/commandline-argfile-missing.args
1212

1313
#[cfg(not(cmdline_set))]

tests/rustdoc-ui/argfile/commandline-argfile-multiple-windows.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// line arguments and is only run on windows.
66
//
77
//@ only-windows
8-
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
9-
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
10-
//@ normalize-stderr-test: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
8+
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
9+
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
10+
//@ normalize-stderr: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
1111
//@ compile-flags: --cfg cmdline_set @{{src-base}}\argfile\commandline-argfile-missing.args @{{src-base}}\argfile\commandline-argfile-badutf8.args @{{src-base}}\argfile\commandline-argfile-missing2.args
1212

1313
#[cfg(not(cmdline_set))]

tests/rustdoc-ui/argfile/commandline-argfile-multiple.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
// windows.
77
//
88
//@ ignore-windows
9-
//@ normalize-stderr-test: "os error \d+" -> "os error $$ERR"
10-
//@ normalize-stderr-test: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
11-
//@ normalize-stderr-test: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
9+
//@ normalize-stderr: "os error \d+" -> "os error $$ERR"
10+
//@ normalize-stderr: "commandline-argfile-missing.args:[^(]*" -> "commandline-argfile-missing.args: $$FILE_MISSING "
11+
//@ normalize-stderr: "commandline-argfile-missing2.args:[^(]*" -> "commandline-argfile-missing2.args: $$FILE_MISSING "
1212
//@ compile-flags: --cfg cmdline_set @{{src-base}}/argfile/commandline-argfile-missing.args @{{src-base}}/argfile/commandline-argfile-badutf8.args @{{src-base}}/argfile/commandline-argfile-missing2.args
1313

1414
#[cfg(not(cmdline_set))]

tests/rustdoc-ui/disambiguator-endswith-named-suffix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ check-pass
2-
//@ normalize-stderr-test: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
2+
//@ normalize-stderr: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL"
33

44
//! [struct@m!()] //~ WARN: unmatched disambiguator `struct` and suffix `!()`
55
//! [struct@m!{}]

0 commit comments

Comments
 (0)