merge(glittershark/achilles): Subtree import at 'b93268085a'
Imported from https://github.com/glittershark/achilles/ git-subtree-dir: users/glittershark/achilles git-subtree-mainline:4d193f2395git-subtree-split:b93268085aChange-Id: I64a583b454bbe03e20358ad7808939a4cbc212ba
This commit is contained in:
commit
b6895a5b30
33 changed files with 4508 additions and 0 deletions
54
users/glittershark/achilles/tests/compile.rs
Normal file
54
users/glittershark/achilles/tests/compile.rs
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
use std::process::Command;
|
||||
|
||||
use crate_root::root;
|
||||
|
||||
const FIXTURES: &[(&str, i32)] = &[("simple", 5), ("functions", 9)];
|
||||
|
||||
#[test]
|
||||
fn compile_and_run_files() {
|
||||
let ach = root().unwrap().join("ach");
|
||||
|
||||
println!("Running: `make clean`");
|
||||
assert!(
|
||||
Command::new("make")
|
||||
.arg("clean")
|
||||
.current_dir(&ach)
|
||||
.spawn()
|
||||
.unwrap()
|
||||
.wait()
|
||||
.unwrap()
|
||||
.success(),
|
||||
"make clean failed"
|
||||
);
|
||||
|
||||
for (fixture, exit_code) in FIXTURES {
|
||||
println!(">>> Testing: {}", fixture);
|
||||
|
||||
println!(" Running: `make {}`", fixture);
|
||||
assert!(
|
||||
Command::new("make")
|
||||
.arg(fixture)
|
||||
.current_dir(&ach)
|
||||
.spawn()
|
||||
.unwrap()
|
||||
.wait()
|
||||
.unwrap()
|
||||
.success(),
|
||||
"make failed"
|
||||
);
|
||||
|
||||
let out_path = ach.join(fixture);
|
||||
println!(" Running: `{}`", out_path.to_str().unwrap());
|
||||
assert_eq!(
|
||||
Command::new(out_path)
|
||||
.spawn()
|
||||
.unwrap()
|
||||
.wait()
|
||||
.unwrap()
|
||||
.code()
|
||||
.unwrap(),
|
||||
*exit_code,
|
||||
);
|
||||
println!(" OK");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue