Skip to content

Rollup of 5 pull requests #127414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jul 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Expectations struct for output-type-permutations
  • Loading branch information
Oneirical committed Jul 5, 2024
commit 811532be6e999c42f8101c6cba62a300da2855cc
10 changes: 6 additions & 4 deletions src/tools/run-make-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,14 @@ pub fn test_while_readonly<P: AsRef<Path>, F: FnOnce() + std::panic::UnwindSafe>
#[track_caller]
pub fn shallow_find_files<P: AsRef<Path>, F: Fn(&PathBuf) -> bool>(
path: P,
closure: F,
filter: F,
) -> Vec<PathBuf> {
let mut matching_files = Vec::new();
for entry in fs_wrapper::read_dir(path) {
let entry = entry.expect("failed to read directory entry.");
let path = entry.path();

if path.is_file() && closure(&path) {
if path.is_file() && filter(&path) {
matching_files.push(path);
}
}
Expand All @@ -296,8 +296,10 @@ pub fn not_contains<P: AsRef<Path>>(path: P, expected: &str) -> bool {
}

/// Returns true if the filename at `path` is not in `expected`.
pub fn name_not_among<P: AsRef<Path>>(path: P, expected: &[&'static str]) -> bool {
path.as_ref().file_name().is_some_and(|name| !expected.contains(&name.to_str().unwrap()))
pub fn filename_not_in_denylist<P: AsRef<Path>>(path: P, expected: &[String]) -> bool {
path.as_ref()
.file_name()
.is_some_and(|name| !expected.contains(&name.to_str().unwrap().to_owned()))
}

/// Use `cygpath -w` on a path to get a Windows path string back. This assumes that `cygpath` is
Expand Down
Loading
Loading