Skip to content

Commit 8ba9f9e

Browse files
committed
Tidy: allow feature-gate tests to be ui tests
ui tests are the future, especially since the recent improvement where we have gained checking and requiring of //~ERROR comments. The tidy feature-gate test check is intended to be 50% an actual insurance that there is a check, and 50% to be a teacher that such checks are required. With this commit applied, newbies might interpret stuff wrongly and create tests that don't fail but succeed instead. This is not what feature gate tests are for though. Therefore, in a later step, when only ui tests are allowed to be feature gate tests, we will add checking to ensure that a file marked as gate test is actually required to be a compilation failure. Right now implementing such a check is a bit annoying as one needs to only do it when the compile-fail test is in the ui test suite :/.
1 parent bd7021f commit 8ba9f9e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/tools/tidy/src/features.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ pub fn check(path: &Path, bad: &mut bool, quiet: bool) {
8989

9090
let mut contents = String::new();
9191

92-
super::walk_many(&[&path.join("test/compile-fail"),
92+
super::walk_many(&[&path.join("test/ui-fulldeps"),
93+
&path.join("test/ui"),
94+
&path.join("test/compile-fail"),
9395
&path.join("test/compile-fail-fulldeps"),
9496
&path.join("test/parse-fail"),],
9597
&mut |path| super::filter_dirs(path),
@@ -150,9 +152,9 @@ pub fn check(path: &Path, bad: &mut bool, quiet: bool) {
150152

151153
for &(name, _) in gate_untested.iter() {
152154
println!("Expected a gate test for the feature '{}'.", name);
153-
println!("Hint: create a file named 'feature-gate-{}.rs' in the compile-fail\
154-
\n test suite, with its failures due to missing usage of\
155-
\n #![feature({})].", name, name);
155+
println!("Hint: create a failing test file named 'feature-gate-{}.rs'\
156+
\n in the 'ui' test suite, with its failures due to\
157+
\n missing usage of #![feature({})].", name, name);
156158
println!("Hint: If you already have such a test and don't want to rename it,\
157159
\n you can also add a // gate-test-{} line to the test file.",
158160
name);

0 commit comments

Comments
 (0)