mirror of
https://github.com/fluencelabs/wasmer
synced 2025-03-30 14:31:07 +00:00
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.
23 lines
640 B
Rust
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
|
|
}
|