Move spec testsuite into tests. (#56)
Move all spec testsuite into `/tests` directory. So it means that several changes will happen: - Compilation will share common dependencies in target directory. This should make CI builds faster. This also should reduce space requirements. - Common Cargo.lock file - `cargo test` will include spec tests. - `cargo check --tests` will also include spec tests.
This commit is contained in:
parent
c99ee1d986
commit
863f2247a3
|
@ -1,3 +1,3 @@
|
||||||
[submodule "spec/testsuite"]
|
[submodule "tests/spec/testsuite"]
|
||||||
path = spec/testsuite
|
path = tests/spec/testsuite
|
||||||
url = https://github.com/webassembly/testsuite
|
url = https://github.com/WebAssembly/testsuite.git
|
||||||
|
|
|
@ -14,7 +14,7 @@ byteorder = "1.0"
|
||||||
memory_units = { git = "https://github.com/pepyakin/memory_units.git", rev = "e09093e" }
|
memory_units = { git = "https://github.com/pepyakin/memory_units.git", rev = "e09093e" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
wabt = "0.1.2"
|
wabt = "0.2.0"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
# 32-bit platforms are not supported and not tested. Use this flag if you really want to use
|
# 32-bit platforms are not supported and not tested. Use this flag if you really want to use
|
||||||
|
|
3
check.sh
3
check.sh
|
@ -5,8 +5,5 @@ set -eux
|
||||||
cd $(dirname $0)
|
cd $(dirname $0)
|
||||||
|
|
||||||
cargo check --tests
|
cargo check --tests
|
||||||
cargo check \
|
|
||||||
--manifest-path=spec/Cargo.toml \
|
|
||||||
--tests
|
|
||||||
|
|
||||||
cd -
|
cd -
|
||||||
|
|
|
@ -10,7 +10,7 @@ cargo-fuzz = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmi = { path = ".." }
|
wasmi = { path = ".." }
|
||||||
wabt = "0.2.1"
|
wabt = "0.2.0"
|
||||||
wasmparser = "0.14.1"
|
wasmparser = "0.14.1"
|
||||||
|
|
||||||
[dependencies.libfuzzer-sys]
|
[dependencies.libfuzzer-sys]
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
[package]
|
|
||||||
name = "wasmi-spec"
|
|
||||||
version = "0.0.0"
|
|
||||||
authors = ["NikVolf <nikvolf@gmail.com>"]
|
|
||||||
license = "MIT/Apache-2.0"
|
|
||||||
readme = "README.md"
|
|
||||||
repository = "https://github.com/nikvolf/parity-wasm"
|
|
||||||
homepage = "https://github.com/nikvolf/parity-wasm"
|
|
||||||
description = "parity-wasm testsuite"
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
wasmi = { path = ".." }
|
|
||||||
wabt = "0.2.0"
|
|
1
test.sh
1
test.sh
|
@ -5,6 +5,5 @@ set -eux
|
||||||
cd $(dirname $0)
|
cd $(dirname $0)
|
||||||
|
|
||||||
time cargo test
|
time cargo test
|
||||||
time cargo test --manifest-path=spec/Cargo.toml
|
|
||||||
|
|
||||||
cd -
|
cd -
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
|
mod run;
|
||||||
|
|
||||||
macro_rules! run_test {
|
macro_rules! run_test {
|
||||||
($label: expr, $test_name: ident) => (
|
($label: expr, $test_name: ident) => (
|
||||||
#[test]
|
#[test]
|
||||||
fn $test_name() {
|
fn $test_name() {
|
||||||
::run::spec($label)
|
self::run::spec($label)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
|
@ -338,7 +338,7 @@ pub fn spec(name: &str) {
|
||||||
|
|
||||||
fn try_spec(name: &str) -> Result<(), Error> {
|
fn try_spec(name: &str) -> Result<(), Error> {
|
||||||
let mut spec_driver = SpecDriver::new();
|
let mut spec_driver = SpecDriver::new();
|
||||||
let spec_script_path = format!("testsuite/{}.wast", name);
|
let spec_script_path = format!("tests/spec/testsuite/{}.wast", name);
|
||||||
let mut parser = ScriptParser::from_file(spec_script_path).expect("Can't read spec script");
|
let mut parser = ScriptParser::from_file(spec_script_path).expect("Can't read spec script");
|
||||||
while let Some(Command { kind, line }) = parser.next()? {
|
while let Some(Command { kind, line }) = parser.next()? {
|
||||||
match kind {
|
match kind {
|
|
@ -1,6 +1,6 @@
|
||||||
|
//! Official spec testsuite.
|
||||||
|
|
||||||
extern crate wasmi;
|
extern crate wasmi;
|
||||||
extern crate wabt;
|
extern crate wabt;
|
||||||
|
|
||||||
mod run;
|
mod spec;
|
||||||
mod fixtures;
|
|
Loading…
Reference in New Issue