Run WASI C API tests based on feature; prevent cmake caching

This commit is contained in:
Mark McCaskey
2019-11-20 15:41:33 -08:00
parent 6831a6d8c9
commit 4a84441ab0
4 changed files with 18 additions and 5 deletions

View File

@ -4,7 +4,14 @@ use std::process::Command;
fn test_c_api() {
let project_tests_dir = concat!(env!("CARGO_MANIFEST_DIR"), "/tests");
run_command("cmake", project_tests_dir, vec!["."]);
let cmake_args = vec![
".",
#[cfg(feature = "wasi")]
"-DWASI_TESTS=ON",
];
// we use -f so it doesn't fail if the fiel doesn't exist
run_command("rm", project_tests_dir, vec!["-f", "CMakeCache.txt"]);
run_command("cmake", project_tests_dir, cmake_args);
run_command("make", project_tests_dir, vec!["-Wdev", "-Werror=dev"]);
run_command("make", project_tests_dir, vec!["test", "ARGS=\"-V\""]);
}