Crate bintest_helper

Crate bintest_helper 

Source
Expand description

§Bintest Helper

Use this in combination with assert_cmd. Example:

fn main() {
    println!("Hello, World!");
}

#[cfg(test)]
mod tests {
    #[bintest_helper::bintest_helper]
    #[test]
    fn main_test() {
        use assert_cmd::Command;
 
        let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
        cmd.assert().stdout("Hello, World!");
    }
}

See also: the examples directory.

Attribute Macros§

bintest_helper
Add this to your unit-tests to (re)build your binary, if performing bintests.