Skip to content

Commit 6a783a4

Browse files
Rollup merge of #133013 - matthiaskrgr:crash_aux, r=onur-ozkan
compiletest: known-bug / crashes: allow for an "auxiliary" directory to contain files that do not have a "known-bug" directive Fixes #133009 r? `@jieyouxu`
2 parents e3c76c5 + 73c6494 commit 6a783a4

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/tools/tidy/src/known_bug.rs

+16-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,22 @@ use crate::walk::*;
66

77
pub fn check(filepath: &Path, bad: &mut bool) {
88
walk(filepath, |path, _is_dir| filter_not_rust(path), &mut |entry, contents| {
9-
let file = entry.path();
10-
if !contents.lines().any(|line| line.starts_with("//@ known-bug: ")) {
9+
let file: &Path = entry.path();
10+
11+
// files in "auxiliary" do not need to crash by themselves
12+
let test_path_segments =
13+
file.iter().map(|s| s.to_string_lossy().into()).collect::<Vec<String>>();
14+
let test_path_segments_str =
15+
test_path_segments.iter().map(|s| s.as_str()).collect::<Vec<&str>>();
16+
17+
if !matches!(test_path_segments_str[..], [
18+
..,
19+
"tests",
20+
"crashes",
21+
"auxiliary",
22+
_aux_file_rs
23+
]) && !contents.lines().any(|line| line.starts_with("//@ known-bug: "))
24+
{
1125
tidy_error!(
1226
bad,
1327
"{} crash/ice test does not have a \"//@ known-bug: \" directive",

0 commit comments

Comments
 (0)