Skip to content
Merged
Changes from all commits
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
14 changes: 14 additions & 0 deletions crates/snapbox/src/cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ pub struct Command {

/// # Builder API
impl Command {
/// Look up the path to a cargo-built binary within an integration test
///
/// Cargo support:
/// - `>1.94`: works
/// - `>=1.91,<=1.93`: works with default `build-dir`
/// - `<=1.92`: works
///
/// # Panic
///
/// Panics if no binary is found
pub fn cargo_bin(name: &str) -> Self {
Self::new(cargo_bin(name))
}

pub fn new(program: impl AsRef<std::ffi::OsStr>) -> Self {
Self {
cmd: std::process::Command::new(program),
Expand Down
Loading