diff options
| author | klensy <klensy@users.noreply.github.com> | 2023-06-23 12:54:34 +0300 |
|---|---|---|
| committer | klensy <klensy@users.noreply.github.com> | 2023-07-04 19:19:49 +0300 |
| commit | a3bca31303fe9ea682cf0a9db79ec07fae8a0f41 (patch) | |
| tree | 7d2645f3b5663826324acf33b07cbcec9eced760 /src | |
| parent | 46d3fc78127798ea7e7c78bca31a8cb7586a7f94 (diff) | |
| download | rust-a3bca31303fe9ea682cf0a9db79ec07fae8a0f41.tar.gz rust-a3bca31303fe9ea682cf0a9db79ec07fae8a0f41.zip | |
tidy: exclude sh files from rust-installer tests from tidy bins check
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/tidy/src/bins.rs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/tools/tidy/src/bins.rs b/src/tools/tidy/src/bins.rs index 197e9a9965f..64ba79dc185 100644 --- a/src/tools/tidy/src/bins.rs +++ b/src/tools/tidy/src/bins.rs @@ -95,17 +95,41 @@ mod os_impl { return true; } + // FIXME: check when rust-installer test sh files will be removed, + // and then remove them from exclude list + const RI_EXCLUSION_LIST: &[&str] = &[ + "src/tools/rust-installer/test/image1/bin/program", + "src/tools/rust-installer/test/image1/bin/program2", + "src/tools/rust-installer/test/image1/bin/bad-bin", + "src/tools/rust-installer/test/image2/bin/oldprogram", + "src/tools/rust-installer/test/image3/bin/cargo", + ]; + + fn filter_rust_installer_no_so_bins(path: &Path) -> bool { + RI_EXCLUSION_LIST.iter().any(|p| path.ends_with(p)) + } + #[cfg(unix)] pub fn check(path: &Path, bad: &mut bool) { use std::ffi::OsStr; const ALLOWED: &[&str] = &["configure", "x"]; + for p in RI_EXCLUSION_LIST { + if !path.join(Path::new(p)).exists() { + tidy_error!(bad, "rust-installer test bins missed: {p}"); + } + } + // FIXME: we don't need to look at all binaries, only files that have been modified in this branch // (e.g. using `git ls-files`). walk_no_read( &[path], - |path, _is_dir| filter_dirs(path) || path.ends_with("src/etc"), + |path, _is_dir| { + filter_dirs(path) + || path.ends_with("src/etc") + || filter_rust_installer_no_so_bins(path) + }, &mut |entry| { let file = entry.path(); let extension = file.extension(); |
