From fea54c4708974eb9e4832c253b945ee29c6d0e0d Mon Sep 17 00:00:00 2001 From: Per <Per Lindgren> Date: Sun, 25 Nov 2018 14:39:09 +0100 Subject: [PATCH] works with llvm7 and klee aur --- .gitignore | 1 + cargo-klee/src/main.rs | 51 ++++++++++++++++++++++++------------------ 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/.gitignore b/.gitignore index 84a323e..98e5fcf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ target **/*.rs.bk +Cargo.lock diff --git a/cargo-klee/src/main.rs b/cargo-klee/src/main.rs index 025dfc2..72b956d 100644 --- a/cargo-klee/src/main.rs +++ b/cargo-klee/src/main.rs @@ -10,7 +10,7 @@ fn main() { let args = env::args().skip(2).collect::<Vec<_>>(); // turn `cargo klee --example foo` into `xargo rustc --example foo -- (..)` - let mut c = Command::new("xargo"); + let mut c = Command::new("cargo"); c.arg("rustc") .args(&args) // verbose output for debugging purposes @@ -91,27 +91,34 @@ fn main() { "debug" }; - let mut docker = Command::new("docker"); - docker - .arg("run") - .arg("--rm") - .args(&["--user", &format!("{}:{}", uid(), gid())]) - .args(&[ - "-v", - &format!("{}:/mnt", env::current_dir().unwrap().display()), - ]) - .args(&["-w", "/mnt"]) - .arg("-it") - .arg("afoht/llvm-klee-4") - .args(&[ - "/usr/bin/klee", - &format!("target/{}/examples/{}{}.bc", profile, example, suffix), - ]); - - // print full command for debugging purposes - eprintln!("{:?}", docker); - - assert!(docker.status().unwrap().success()); + // let mut docker = Command::new("docker"); + // docker + // .arg("run") + // .arg("--rm") + // .args(&["--user", &format!("{}:{}", uid(), gid())]) + // .args(&[ + // "-v", + // &format!("{}:/mnt", env::current_dir().unwrap().display()), + // ]) + // .args(&["-w", "/mnt"]) + // .arg("-it") + // .arg("afoht/llvm-klee-4") + // .args(&[ + // "/usr/bin/klee", + // &format!("target/{}/examples/{}{}.bc", profile, example, suffix), + // ]); + + // // print full command for debugging purposes + // eprintln!("{:?}", docker); + // + // assert!(docker.status().unwrap().success()); + let mut klee_cmd = Command::new("klee"); + klee_cmd.arg(&format!( + "target/{}/examples/{}{}.ll", + profile, example, suffix + )); + eprintln!("{:?}", klee_cmd); + assert!(klee_cmd.status().unwrap().success()); } // NOTE from cross -- GitLab