pub fn target_binary() -> &'static OsStr {
        const TARGET_BINARY: &str = "MANTICORE_E2E_TARGET_BINARY";
        lazy_static::lazy_static! {
            static ref BINARY_PATH: OsString = match env::var_os(TARGET_BINARY) {
                Some(bin) => bin,
                None => {
                    // In order to blow up the test binary, we need to call
                    // abort ourselves. Not only that, but we need to be clever
                    // to defeat the standard library's test output capture...
                    use std::os::unix::io::FromRawFd;
                    use std::io::Write;
                    use std::fs::File;
                    use std::process;

                    #[allow(unsafe_code)]
                    let mut stderr = unsafe { File::from_raw_fd(2) };
                    let _ = writeln!(
                        stderr,
                        "Could not find environment variable {}; aborting.",
                        TARGET_BINARY
                    );
                    let _ = writeln!(
                        stderr,
                        "Consider using the e2e/run.sh script, instead."
                    );
                    process::abort();
                }
            };
        }
        &BINARY_PATH
    }
/// Extracts the name of the binary-under-test from the environment.
///
/// If missing, aborts the process. This will bypass the Rust test harness's
/// attempt to continue running other tests.
Extracts the name of the binary-under-test from the environment.
If missing, aborts the process. This will bypass the Rust test harness's
attempt to continue running other tests.
Extracts the name of the binary - under - test from the environment . If missing aborts the process . This will bypass the Rust test harness ' s attempt to continue running other tests .
pub fn target_binary() -> &'static OsStr {
        const TARGET_BINARY: &str = "MANTICORE_E2E_TARGET_BINARY";
        lazy_static::lazy_static! {
            static ref BINARY_PATH: OsString = match env::var_os(TARGET_BINARY) {
                Some(bin) => bin,
                None => {
                    // In order to blow up the test binary, we need to call
                    // abort ourselves. Not only that, but we need to be clever
                    // to defeat the standard library's test output capture...
                    use std::os::unix::io::FromRawFd;
                    use std::io::Write;
                    use std::fs::File;
                    use std::process;
                    #[allow(unsafe_code)]
                    let mut stderr = unsafe { File::from_raw_fd(2) };
                    let _ = writeln!(
                        stderr,
                        "Could not find environment variable {}; aborting.",
                        TARGET_BINARY
                    );
                    let _ = writeln!(
                        stderr,
                        "Consider using the e2e/run.sh script, instead."
                    );
                    process::abort();
                }
            };
        }
        &BINARY_PATH
    }
pub fn target_binary ( ) -> & ' static OsStr { const TARGET_BINARY : & str = " " ; lazy_static :: lazy_static ! { static ref BINARY_PATH OsString match env var_os ( TARGET_BINARY ) { Some ( bin ) bin None { // In order to blow up the test binary, we need to call // abort ourselves. Not only that, but we need to be clever // to defeat the standard library's test output capture... use std os unix io FromRawFd use std io Write use std fs File use std process [ allow ( unsafe_code ) ] let mut stderr unsafe { File from_raw_fd ( 2 ) } let writeln ( stderr " " TARGET_BINARY ) let writeln ( stderr " " ) process abort ( ) } } } & BINARY_PATH }
Extracts the name of the binary-under-test from the environment.
Extracts the name of the binary - under - test from the environment .