Convert the wast test harness into a crate.
This uses a build.rs file to collect all the wast tests and create individual `#[test]` lines for them, so that `cargo test` can run them in parallel.
This commit is contained in:
22
lib/wast/tests/wast_files.rs
Normal file
22
lib/wast/tests/wast_files.rs
Normal file
@@ -0,0 +1,22 @@
|
||||
extern crate cranelift_codegen;
|
||||
extern crate cranelift_native;
|
||||
extern crate wasmtime_wast;
|
||||
|
||||
use cranelift_codegen::isa;
|
||||
use cranelift_codegen::settings;
|
||||
use cranelift_codegen::settings::Configurable;
|
||||
use std::path::Path;
|
||||
use wasmtime_wast::wast_file;
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/run_wast_files.rs"));
|
||||
|
||||
#[cfg(test)]
|
||||
fn native_isa() -> Box<isa::TargetIsa> {
|
||||
let mut flag_builder = settings::builder();
|
||||
flag_builder.enable("enable_verifier").unwrap();
|
||||
|
||||
let isa_builder = cranelift_native::builder().unwrap_or_else(|_| {
|
||||
panic!("host machine is not a supported target");
|
||||
});
|
||||
isa_builder.finish(settings::Flags::new(flag_builder))
|
||||
}
|
||||
Reference in New Issue
Block a user