Skip to content

Commit 82bcc70

Browse files
yrashkhucsmn
authored andcommitted
Enable testing on macOS
The binary files were taken from homebrew bottle, version 4.3
1 parent 8752863 commit 82bcc70

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

assets/bin/bsdiff.macos

34.1 KB
Binary file not shown.

assets/bin/bspatch.macos

164 KB
Binary file not shown.

utils/src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,22 @@ fn get_binary_in<P: AsRef<Path>>(dir: P, name: &str) -> io::Result<path::PathBuf
289289
Ok(dir.as_ref().join(format!("{}.exe", name)))
290290
}
291291

292-
#[cfg(unix)]
292+
#[cfg(all(unix, not(target_os = "macos")))]
293293
fn get_binary_in<P: AsRef<Path>>(dir: P, name: &str) -> io::Result<path::PathBuf> {
294294
use std::os::unix::fs::PermissionsExt;
295295
let bin = dir.as_ref().join(name);
296296
fs::set_permissions(bin.as_path(), fs::Permissions::from_mode(0o755))?;
297297
Ok(bin)
298298
}
299299

300+
#[cfg(all(unix, target_os = "macos"))]
301+
fn get_binary_in<P: AsRef<Path>>(dir: P, name: &str) -> io::Result<path::PathBuf> {
302+
use std::os::unix::fs::PermissionsExt;
303+
let bin = dir.as_ref().join(name).with_extension("macos");
304+
fs::set_permissions(bin.as_path(), fs::Permissions::from_mode(0o755))?;
305+
Ok(bin)
306+
}
307+
300308
/// Test sample.
301309
pub struct Sample {
302310
pub name: String,

0 commit comments

Comments
 (0)