From 2c6fbcba1f3d60ce9866bc1692bb3aa332435e54 Mon Sep 17 00:00:00 2001 From: Syrus Date: Thu, 1 Aug 2019 01:27:36 -0700 Subject: [PATCH] Improved runtime_c_api_tests --- lib/runtime-c-api/tests/runtime_c_api_tests.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/runtime-c-api/tests/runtime_c_api_tests.rs b/lib/runtime-c-api/tests/runtime_c_api_tests.rs index 98c9c27b1..0e3257786 100644 --- a/lib/runtime-c-api/tests/runtime_c_api_tests.rs +++ b/lib/runtime-c-api/tests/runtime_c_api_tests.rs @@ -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);