Skip to content

Commit

Permalink
Improved runtime_c_api_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed Aug 1, 2019
1 parent 052ad13 commit 2c6fbcb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/runtime-c-api/tests/runtime_c_api_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@ use std::process::Command;
fn test_c_api() {
let project_tests_dir = concat!(env!("CARGO_MANIFEST_DIR"), "/tests");

run_command("cmake", project_tests_dir, Some("."));
run_command("make", project_tests_dir, Some("-Wdev -Werror=dev"));
run_command("make", project_tests_dir, Some("test VERBOSE=1"));
run_command("cmake", project_tests_dir, vec!["."]);
run_command("make", project_tests_dir, vec!["-Wdev", "-Werror=dev"]);
run_command("make", project_tests_dir, vec!["test", "ARGS=\"-V\""]);
}

fn run_command(command_str: &str, dir: &str, arg: Option<&str>) {
println!("Running command: `{}` arg: {:?}", command_str, arg);
fn run_command(command_str: &str, dir: &str, args: Vec<&str>) {
println!("Running command: `{}` args: {:?}", command_str, args);

let mut command = Command::new(command_str);

if let Some(a) = arg {
command.arg(a);
}
command.args(&args);

command.current_dir(dir);

Expand Down

0 comments on commit 2c6fbcb

Please sign in to comment.