Move most wasmtime tests into one test suite (#1544)

* Move most wasmtime tests into one test suite

This commit moves most wasmtime tests into a single test suite which
gets compiled into one executable instead of having lots of test
executables. The goal here is to reduce disk space on CI, and this
should be achieved by having fewer executables which means fewer copies
of `libwasmtime.rlib` linked across binaries on the system. More
importantly though this means that DWARF debug information should only
be in one executable rather than duplicated across many.

* Share more build caches

Globally set `RUSTFLAGS` to `-Dwarnings` instead of individually so all
build steps share the same value.

* Allow some dead code in cranelift-codegen

Prevents having to fix all warnings for all possible feature
combinations, only the main ones which come up.

* Update some debug file paths
This commit is contained in:
Alex Crichton
2020-04-17 17:22:12 -05:00
committed by GitHub
parent a524f58dfe
commit 4c82da440a
39 changed files with 49 additions and 34 deletions

View File

@@ -24,10 +24,9 @@ pub(crate) fn init_fuzzing() {
INIT.call_once(|| {
let _ = env_logger::try_init();
rayon::ThreadPoolBuilder::new()
let _ = rayon::ThreadPoolBuilder::new()
.num_threads(1)
.build_global()
.expect("should only initialize the rayon thread pool once!");
.build_global();
})
}

View File

@@ -1,29 +0,0 @@
//! Regression tests for bugs found via fuzzing.
//!
//! The `#[test]` goes in here, the Wasm binary goes in
//! `./regressions/some-descriptive-name.wasm`, and then the `#[test]` should
//! use the Wasm binary by including it via
//! `include_bytes!("./regressions/some-descriptive-name.wasm")`.
use wasmtime::{Config, Strategy};
use wasmtime_fuzzing::oracles;
#[test]
fn instantiate_empty_module() {
let data = wat::parse_str(include_str!("./regressions/empty.wat")).unwrap();
oracles::instantiate(&data, Strategy::Auto);
}
#[test]
fn instantiate_empty_module_with_memory() {
let data = wat::parse_str(include_str!("./regressions/empty_with_memory.wat")).unwrap();
oracles::instantiate(&data, Strategy::Auto);
}
#[test]
fn instantiate_module_that_compiled_to_x64_has_register_32() {
let mut config = Config::new();
config.debug_info(true);
let data = wat::parse_str(include_str!("./regressions/issue694.wat")).unwrap();
oracles::instantiate_with_config(&data, config);
}

View File

@@ -1,2 +0,0 @@
This directory contains `.wasm` binaries generated during fuzzing that uncovered
a bug, and which we now use as regression tests in `../regressions.rs`.

View File

@@ -1 +0,0 @@
(module)

View File

@@ -1 +0,0 @@
(module (memory 1))

View File

@@ -1,49 +0,0 @@
(module
(type (;0;) (func))
(type (;1;) (func (param i64)))
(func (;0;) (type 0))
(func (;1;) (type 0))
(func (;2;) (type 0))
(func (;3;) (type 0))
(func (;4;) (type 1) (param i64)
(local f32 f32 f32)
loop (result i64) ;; label = @1
global.get 0
if ;; label = @2
local.get 1
return
end
block (result i64) ;; label = @2
loop ;; label = @3
block ;; label = @4
global.get 0
if ;; label = @5
i32.const 5
if (result f32) ;; label = @6
block (result f32) ;; label = @7
call 0
i32.const 7
if (result f32) ;; label = @8
local.get 2
else
f32.const 0x1p+0 (;=1;)
end
end
else
f32.const 0x1p+0 (;=1;)
end
local.tee 1
local.set 3
end
end
end
i32.const 8
br_if 1 (;@1;)
i64.const 4
end
end
return)
(memory (;0;) 1)
(global (;0;) i32 (i32.const 0))
)