run_make_support: rename recursive_diff to assert_recursive_eq

This commit is contained in:
许杰友 Jieyou Xu (Joe) 2024-07-15 11:55:57 +00:00
parent f66d3d33e4
commit 230804dc3a

View File

@ -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.
pub fn recursive_diff(dir1: impl AsRef<Path>, dir2: impl AsRef<Path>) {
/// Assert that all files in `dir1` exist and have the same content in `dir2`
pub fn assert_recursive_eq(dir1: impl AsRef<Path>, dir2: impl AsRef<Path>) {
let dir2 = dir2.as_ref();
read_dir(dir1, |entry_path| {
let entry_name = entry_path.file_name().unwrap();
if entry_path.is_dir() {
recursive_diff(&entry_path, &dir2.join(entry_name));
assert_recursive_eq(&entry_path, &dir2.join(entry_name));
} else {
let path2 = dir2.join(entry_name);
let file1 = fs_wrapper::read(&entry_path);