run_make_support: rename recursive_diff
to assert_recursive_eq
This commit is contained in:
parent
f66d3d33e4
commit
230804dc3a
1 changed files with 3 additions and 3 deletions
|
@ -137,13 +137,13 @@ pub fn set_host_rpath(cmd: &mut Command) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Check that all files in `dir1` exist and have the same content in `dir2`. Panic otherwise.
|
/// Assert that all files in `dir1` exist and have the same content in `dir2`
|
||||||
pub fn recursive_diff(dir1: impl AsRef<Path>, dir2: impl AsRef<Path>) {
|
pub fn assert_recursive_eq(dir1: impl AsRef<Path>, dir2: impl AsRef<Path>) {
|
||||||
let dir2 = dir2.as_ref();
|
let dir2 = dir2.as_ref();
|
||||||
read_dir(dir1, |entry_path| {
|
read_dir(dir1, |entry_path| {
|
||||||
let entry_name = entry_path.file_name().unwrap();
|
let entry_name = entry_path.file_name().unwrap();
|
||||||
if entry_path.is_dir() {
|
if entry_path.is_dir() {
|
||||||
recursive_diff(&entry_path, &dir2.join(entry_name));
|
assert_recursive_eq(&entry_path, &dir2.join(entry_name));
|
||||||
} else {
|
} else {
|
||||||
let path2 = dir2.join(entry_name);
|
let path2 = dir2.join(entry_name);
|
||||||
let file1 = fs_wrapper::read(&entry_path);
|
let file1 = fs_wrapper::read(&entry_path);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue