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:
Sergey Pepyakin 2018-02-14 18:03:39 +03:00 committed by GitHub
parent c99ee1d986
commit 863f2247a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 11 additions and 26 deletions

6
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "spec/testsuite"]
path = spec/testsuite
url = https://github.com/webassembly/testsuite
[submodule "tests/spec/testsuite"]
path = tests/spec/testsuite
url = https://github.com/WebAssembly/testsuite.git

View File

@ -14,7 +14,7 @@ byteorder = "1.0"
memory_units = { git = "https://github.com/pepyakin/memory_units.git", rev = "e09093e" }
[dev-dependencies]
wabt = "0.1.2"
wabt = "0.2.0"
[features]
# 32-bit platforms are not supported and not tested. Use this flag if you really want to use

View File

@ -5,8 +5,5 @@ set -eux
cd $(dirname $0)
cargo check --tests
cargo check \
--manifest-path=spec/Cargo.toml \
--tests
cd -

View File

@ -10,7 +10,7 @@ cargo-fuzz = true
[dependencies]
wasmi = { path = ".." }
wabt = "0.2.1"
wabt = "0.2.0"
wasmparser = "0.14.1"
[dependencies.libfuzzer-sys]

View File

@ -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"

View File

@ -5,6 +5,5 @@ set -eux
cd $(dirname $0)
time cargo test
time cargo test --manifest-path=spec/Cargo.toml
cd -

View File

@ -1,8 +1,10 @@
mod run;
macro_rules! run_test {
($label: expr, $test_name: ident) => (
#[test]
fn $test_name() {
::run::spec($label)
self::run::spec($label)
}
);
}

View File

@ -338,7 +338,7 @@ pub fn spec(name: &str) {
fn try_spec(name: &str) -> Result<(), Error> {
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");
while let Some(Command { kind, line }) = parser.next()? {
match kind {

View File

@ -1,6 +1,6 @@
//! Official spec testsuite.
extern crate wasmi;
extern crate wabt;
mod run;
mod fixtures;
mod spec;