tidy: skip revision llvm-components check for run-make tests

Since run-make tests do not support revisions.
This commit is contained in:
许杰友 Jieyou Xu (Joe) 2024-08-26 18:19:10 +08:00
parent 3f121b9461
commit 92b10819ef

View File

@ -36,8 +36,8 @@ struct RevisionInfo<'a> {
llvm_components: Option<Vec<&'a str>>,
}
pub fn check(path: &Path, bad: &mut bool) {
crate::walk::walk(path, |path, _is_dir| filter_not_rust(path), &mut |entry, content| {
pub fn check(tests_path: &Path, bad: &mut bool) {
crate::walk::walk(tests_path, |path, _is_dir| filter_not_rust(path), &mut |entry, content| {
let file = entry.path().display();
let mut header_map = BTreeMap::new();
iter_header(content, &mut |HeaderLine { revision, directive, .. }| {
@ -65,6 +65,12 @@ pub fn check(path: &Path, bad: &mut bool) {
}
}
});
// Skip run-make tests as revisions are not supported.
if entry.path().strip_prefix(tests_path).is_ok_and(|rest| rest.starts_with("run-make")) {
return;
}
for (rev, RevisionInfo { target_arch, llvm_components }) in &header_map {
let rev = rev.unwrap_or("[unspecified]");
match (target_arch, llvm_components) {