diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-11-13 22:33:45 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2024-11-13 22:36:14 +0100 |
| commit | 73c6494f7ad5da5c0548f5e0efe3c265bb7da641 (patch) | |
| tree | 75112d5ca027eef70e7e853f3ceb0d0f95b7705c | |
| parent | a00df61387e5389d6fe23e38e657f90d672668b1 (diff) | |
| download | rust-73c6494f7ad5da5c0548f5e0efe3c265bb7da641.tar.gz rust-73c6494f7ad5da5c0548f5e0efe3c265bb7da641.zip | |
compiletest: known-bug / crashes: allow for an "auxiliary" directory to contain files that do not have a "known-bug" directive
Fixes #133009
| -rw-r--r-- | src/tools/tidy/src/known_bug.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/tools/tidy/src/known_bug.rs b/src/tools/tidy/src/known_bug.rs index 182a81c6ec9..a8771654144 100644 --- a/src/tools/tidy/src/known_bug.rs +++ b/src/tools/tidy/src/known_bug.rs @@ -6,8 +6,22 @@ use crate::walk::*; pub fn check(filepath: &Path, bad: &mut bool) { walk(filepath, |path, _is_dir| filter_not_rust(path), &mut |entry, contents| { - let file = entry.path(); - if !contents.lines().any(|line| line.starts_with("//@ known-bug: ")) { + let file: &Path = entry.path(); + + // files in "auxiliary" do not need to crash by themselves + let test_path_segments = + file.iter().map(|s| s.to_string_lossy().into()).collect::<Vec<String>>(); + let test_path_segments_str = + test_path_segments.iter().map(|s| s.as_str()).collect::<Vec<&str>>(); + + if !matches!(test_path_segments_str[..], [ + .., + "tests", + "crashes", + "auxiliary", + _aux_file_rs + ]) && !contents.lines().any(|line| line.starts_with("//@ known-bug: ")) + { tidy_error!( bad, "{} crash/ice test does not have a \"//@ known-bug: \" directive", |
