Mark McCaskey 6a5efcda98 Update wasi-tests to test multiple versions of WASI
This change also cleans up the `wasi-test` generation a bit.  It's
actually still really, really messy, but at least now it's split up
into easier to understand chunks.

There's still a lot of low-hanging fruit in terms of improving the
readibilty and maintainability of the code.
2020-03-13 15:41:50 -07:00

23 lines
640 B
Rust

pub fn print_info_on_error(output: &std::process::Output, context: &str) {
if !output.status.success() {
println!("{}", context);
println!(
"stdout:\n{}",
std::str::from_utf8(&output.stdout[..]).unwrap()
);
eprintln!(
"stderr:\n{}",
std::str::from_utf8(&output.stderr[..]).unwrap()
);
}
}
/// Whether or not we should operate on all WASI tests or not
pub fn should_operate_on_all_wasi_tests() -> bool {
std::env::var("WASI_TEST_GENERATE_ALL")
.ok()
.and_then(|s| s.parse::<u32>().ok())
.unwrap_or(0)
== 1
}