2019-05-17 12:09:31 -07:00
|
|
|
use std::env;
|
|
|
|
|
2020-03-13 15:41:50 -07:00
|
|
|
mod set_up_toolchain;
|
|
|
|
mod util;
|
|
|
|
mod wasi_version;
|
2019-05-17 12:09:31 -07:00
|
|
|
mod wasitests;
|
|
|
|
|
|
|
|
static WASITESTS_ENV_VAR: &str = "WASM_WASI_GENERATE_WASITESTS";
|
2020-03-13 15:41:50 -07:00
|
|
|
static WASITESTS_SET_UP_TOOLCHAIN: &str = "WASM_WASI_SET_UP_TOOLCHAIN";
|
2019-05-17 12:09:31 -07:00
|
|
|
|
|
|
|
fn main() {
|
2020-03-13 15:41:50 -07:00
|
|
|
let do_all_wasi_tests = util::should_operate_on_all_wasi_tests();
|
|
|
|
if env::var(WASITESTS_SET_UP_TOOLCHAIN).unwrap_or("0".to_string()) == "1" {
|
|
|
|
set_up_toolchain::set_it_up(do_all_wasi_tests);
|
|
|
|
}
|
|
|
|
|
2019-05-17 12:09:31 -07:00
|
|
|
if env::var(WASITESTS_ENV_VAR).unwrap_or("0".to_string()) == "1" {
|
2020-03-13 15:41:50 -07:00
|
|
|
wasitests::build(do_all_wasi_tests);
|
2019-05-17 12:09:31 -07:00
|
|
|
}
|
|
|
|
}
|