fn run(opt: &Opt, name: &str, entry: &str, bcfile: &Path, out_dir: &Path) -> CVResult<Status> {
    let mut cmd = Command::new("smack");

    let user_flags: Vec<_> = opt
        .backend_flags
        .iter()
        .map(|flag| backends_common::format_flag(&flag, &entry, &bcfile, &out_dir))
        .collect::<Result<_, _>>()?;

    cmd.arg("--verifier=boogie")
        .args(user_flags)
        .arg(String::from("--entry-points=") + entry)
        .arg(bcfile);
    let (stdout, stderr, _) = cmd.output_info_ignore_exit(&opt, Verbosity::Major)?;

    // Scan for result mesage
    let status = stderr
        .lines()
        .chain(stdout.lines())
        .find_map(|l| {
            if l.starts_with("SMACK found no errors") {
                Some(Status::Verified)
            } else if l.starts_with("SMACK found an error") {
                Some(Status::Error)
            } else {
                None
            }
        })
        .unwrap_or_else(|| {
            warn!("Unable to determine status of {}", name);
            Status::Unknown
        });

    Ok(status)
}
/// Run Smack and analyse its output.
Run Smack and analyse its output.
Run Smack and analyse its output .
fn run(opt: &Opt, name: &str, entry: &str, bcfile: &Path, out_dir: &Path) -> CVResult<Status> {
    let mut cmd = Command::new("smack");
    let user_flags: Vec<_> = opt
        .backend_flags
        .iter()
        .map(|flag| backends_common::format_flag(&flag, &entry, &bcfile, &out_dir))
        .collect::<Result<_, _>>()?;
    cmd.arg("--verifier=boogie")
        .args(user_flags)
        .arg(String::from("--entry-points=") + entry)
        .arg(bcfile);
    let (stdout, stderr, _) = cmd.output_info_ignore_exit(&opt, Verbosity::Major)?;
    // Scan for result mesage
    let status = stderr
        .lines()
        .chain(stdout.lines())
        .find_map(|l| {
            if l.starts_with("SMACK found no errors") {
                Some(Status::Verified)
            } else if l.starts_with("SMACK found an error") {
                Some(Status::Error)
            } else {
                None
            }
        })
        .unwrap_or_else(|| {
            warn!("Unable to determine status of {}", name);
            Status::Unknown
        });
    Ok(status)
}
fn run ( opt : & Opt , name : & str , entry : & str , bcfile : & Path , out_dir : & Path ) -> CVResult < Status > { let mut cmd = Command :: new ( " " ) ; let user_flags : Vec < _ > = opt . backend_flags . iter ( ) . map ( | flag | backends_common :: format_flag ( & flag , & entry , & bcfile , & out_dir ) ) . collect :: < Result < _ , _ > > ( ) ? ; cmd . arg ( " " ) . args ( user_flags ) . arg ( String :: from ( " " ) + entry ) . arg ( bcfile ) ; let ( stdout , stderr , _ ) = cmd . output_info_ignore_exit ( & opt , Verbosity :: Major ) ? ; // Scan for result mesage let status = stderr . lines ( ) . chain ( stdout . lines ( ) ) . find_map ( | l | { if l . starts_with ( " " ) { Some ( Status :: Verified ) } else if l . starts_with ( " " ) { Some ( Status :: Error ) } else { None } } ) . unwrap_or_else ( | | { warn ! ( " " name ) ; Status :: Unknown } ) ; Ok ( status ) }
Run Smack and analyse its output.
Run Smack and analyse its output .
opt
&Opt
name
&str
entry
&str
bcfile
&Path
out_dir
&Path
opt
&Opt
name
&str
entry
&str
bcfile
&Path
out_dir
&Path