Skip to content

Commit

Permalink
Improved wast tests
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed May 3, 2020
1 parent 9e107aa commit bd2b648
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ fn main() -> anyhow::Result<()> {
with_backends(&mut spectests, &backends, |mut spectests| {
with_test_module(&mut spectests, "spec", |spectests| {
let _spec_tests = test_directory(spectests, "tests/wast/spec", wast_processor)?;
test_directory_module(spectests, "tests/wast/spec/proposals/multi-value", wast_processor)?;
// test_directory_module(spectests, "tests/wast/spec/proposals/bulk-memory-operations", wast_processor)?;
Ok(())
})?;
with_test_module(&mut spectests, "wasmer", |spectests| {
Expand Down
3 changes: 2 additions & 1 deletion lib/api/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ impl Instance {
/// set of imports resolved by the [`Resolver`].
///
/// The resolver can be anything that implements the [`Resolver`] trait,
/// so you can plug custom resolution for the imports.
/// so you can plug custom resolution for the imports, if you wish not
/// to use [`ImportObject`].
///
/// The [`ImportObject`] is the easiest way to provide imports to the instance.
///
Expand Down
3 changes: 2 additions & 1 deletion lib/wasm-common/src/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ impl Features {
reference_types: false,
simd: false,
bulk_memory: false,
multi_value: false,
// Multivalue should be on by default
multi_value: true,
}
}

Expand Down
5 changes: 4 additions & 1 deletion tests/wast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ fn run_wast(wast_path: &str, compiler: &str) -> anyhow::Result<()> {
println!("Running wast {} with {}", wast_path, compiler);
let try_nan_canonicalization = wast_path.contains("nan-canonicalization");
let mut features = Features::default();
features.multi_value(true);
if wast_path.contains("bulk-memory") {
features.bulk_memory(true);
}
let compiler_config =
get_compiler_config_from_str(compiler, try_nan_canonicalization, features);
let tunables = Tunables::for_target(compiler_config.target().triple());
let store = Store::new(&Engine::new(&*compiler_config, tunables));
let mut wast = Wast::new_with_spectest(store);
// wast.fail_fast = false;
let path = Path::new(wast_path);
wast.run_file(path)
}

0 comments on commit bd2b648

Please sign in to comment.