mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-30 00:51:34 +00:00
Move integration tests to tests
dir in workspace root
This commit is contained in:
68
Cargo.lock
generated
68
Cargo.lock
generated
@ -30,14 +30,6 @@ version = "1.0.26"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7825f6833612eb2414095684fcf6c635becf3ce97fe48cf6421321e93bfbd53c"
|
checksum = "7825f6833612eb2414095684fcf6c635becf3ce97fe48cf6421321e93bfbd53c"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "api-tests"
|
|
||||||
version = "0.16.2"
|
|
||||||
dependencies = [
|
|
||||||
"wabt",
|
|
||||||
"wasmer",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "arrayref"
|
name = "arrayref"
|
||||||
version = "0.3.6"
|
version = "0.3.6"
|
||||||
@ -761,6 +753,14 @@ version = "0.3.55"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2"
|
checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "generate-wasi-tests"
|
||||||
|
version = "0.16.2"
|
||||||
|
dependencies = [
|
||||||
|
"glob 0.3.0",
|
||||||
|
"tempfile",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "generational-arena"
|
name = "generational-arena"
|
||||||
version = "0.2.7"
|
version = "0.2.7"
|
||||||
@ -2739,8 +2739,10 @@ version = "0.16.2"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"atty",
|
"atty",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
|
"criterion",
|
||||||
"errno",
|
"errno",
|
||||||
"fern",
|
"fern",
|
||||||
|
"generate-wasi-tests",
|
||||||
"glob 0.3.0",
|
"glob 0.3.0",
|
||||||
"log",
|
"log",
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
@ -2756,13 +2758,11 @@ dependencies = [
|
|||||||
"wasmer-kernel-loader",
|
"wasmer-kernel-loader",
|
||||||
"wasmer-llvm-backend",
|
"wasmer-llvm-backend",
|
||||||
"wasmer-middleware-common",
|
"wasmer-middleware-common",
|
||||||
"wasmer-middleware-common-tests",
|
|
||||||
"wasmer-runtime",
|
"wasmer-runtime",
|
||||||
"wasmer-runtime-core",
|
"wasmer-runtime-core",
|
||||||
"wasmer-singlepass-backend",
|
"wasmer-singlepass-backend",
|
||||||
"wasmer-wasi",
|
"wasmer-wasi",
|
||||||
"wasmer-wasi-experimental-io-devices",
|
"wasmer-wasi-experimental-io-devices",
|
||||||
"wasmer-wasi-tests",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2887,16 +2887,6 @@ dependencies = [
|
|||||||
"winapi 0.3.8",
|
"winapi 0.3.8",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wasmer-llvm-backend-tests"
|
|
||||||
version = "0.10.2"
|
|
||||||
dependencies = [
|
|
||||||
"wabt",
|
|
||||||
"wasmer-llvm-backend",
|
|
||||||
"wasmer-runtime",
|
|
||||||
"wasmer-runtime-core",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasmer-middleware-common"
|
name = "wasmer-middleware-common"
|
||||||
version = "0.16.2"
|
version = "0.16.2"
|
||||||
@ -2904,19 +2894,6 @@ dependencies = [
|
|||||||
"wasmer-runtime-core",
|
"wasmer-runtime-core",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wasmer-middleware-common-tests"
|
|
||||||
version = "0.16.2"
|
|
||||||
dependencies = [
|
|
||||||
"criterion",
|
|
||||||
"wabt",
|
|
||||||
"wasmer-clif-backend",
|
|
||||||
"wasmer-llvm-backend",
|
|
||||||
"wasmer-middleware-common",
|
|
||||||
"wasmer-runtime-core",
|
|
||||||
"wasmer-singlepass-backend",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasmer-runtime"
|
name = "wasmer-runtime"
|
||||||
version = "0.16.2"
|
version = "0.16.2"
|
||||||
@ -2974,17 +2951,6 @@ dependencies = [
|
|||||||
"winapi 0.3.8",
|
"winapi 0.3.8",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wasmer-runtime-core-tests"
|
|
||||||
version = "0.16.2"
|
|
||||||
dependencies = [
|
|
||||||
"wabt",
|
|
||||||
"wasmer-clif-backend",
|
|
||||||
"wasmer-llvm-backend",
|
|
||||||
"wasmer-runtime-core",
|
|
||||||
"wasmer-singlepass-backend",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasmer-singlepass-backend"
|
name = "wasmer-singlepass-backend"
|
||||||
version = "0.16.2"
|
version = "0.16.2"
|
||||||
@ -3044,20 +3010,6 @@ dependencies = [
|
|||||||
"wasmer-wasi",
|
"wasmer-wasi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "wasmer-wasi-tests"
|
|
||||||
version = "0.16.2"
|
|
||||||
dependencies = [
|
|
||||||
"glob 0.3.0",
|
|
||||||
"tempfile",
|
|
||||||
"wasmer-clif-backend",
|
|
||||||
"wasmer-dev-utils",
|
|
||||||
"wasmer-llvm-backend",
|
|
||||||
"wasmer-runtime",
|
|
||||||
"wasmer-singlepass-backend",
|
|
||||||
"wasmer-wasi",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wasmer-win-exception-handler"
|
name = "wasmer-win-exception-handler"
|
||||||
version = "0.16.2"
|
version = "0.16.2"
|
||||||
|
18
Cargo.toml
18
Cargo.toml
@ -38,49 +38,48 @@ wasmer-llvm-backend = { path = "lib/llvm-backend", optional = true }
|
|||||||
wasmer-wasi = { path = "lib/wasi", optional = true }
|
wasmer-wasi = { path = "lib/wasi", optional = true }
|
||||||
wasmer-kernel-loader = { path = "lib/kernel-loader", optional = true }
|
wasmer-kernel-loader = { path = "lib/kernel-loader", optional = true }
|
||||||
wasmer-dev-utils = { path = "lib/dev-utils", optional = true }
|
wasmer-dev-utils = { path = "lib/dev-utils", optional = true }
|
||||||
wasmer-wasi-tests = { path = "lib/wasi-tests", optional = true }
|
|
||||||
wasmer-middleware-common-tests = { path = "lib/middleware-common-tests", optional = true }
|
|
||||||
wasmer-emscripten-tests = { path = "lib/emscripten-tests", optional = true }
|
wasmer-emscripten-tests = { path = "lib/emscripten-tests", optional = true }
|
||||||
wasmer-wasi-experimental-io-devices = { path = "lib/wasi-experimental-io-devices", optional = true }
|
wasmer-wasi-experimental-io-devices = { path = "lib/wasi-experimental-io-devices", optional = true }
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [
|
members = [
|
||||||
"lib/api",
|
"lib/api",
|
||||||
"lib/api-tests",
|
|
||||||
"lib/clif-backend",
|
"lib/clif-backend",
|
||||||
"lib/singlepass-backend",
|
"lib/singlepass-backend",
|
||||||
"lib/runtime",
|
"lib/runtime",
|
||||||
"lib/runtime-core",
|
"lib/runtime-core",
|
||||||
"lib/runtime-core-tests",
|
|
||||||
"lib/emscripten",
|
"lib/emscripten",
|
||||||
"lib/spectests",
|
"lib/spectests",
|
||||||
"lib/win-exception-handler",
|
"lib/win-exception-handler",
|
||||||
"lib/runtime-c-api",
|
"lib/runtime-c-api",
|
||||||
"lib/llvm-backend",
|
"lib/llvm-backend",
|
||||||
"lib/llvm-backend-tests",
|
|
||||||
"lib/wasi",
|
"lib/wasi",
|
||||||
"lib/middleware-common",
|
"lib/middleware-common",
|
||||||
"lib/kernel-loader",
|
"lib/kernel-loader",
|
||||||
"lib/kernel-net",
|
"lib/kernel-net",
|
||||||
"lib/dev-utils",
|
"lib/dev-utils",
|
||||||
"lib/wasi-experimental-io-devices",
|
"lib/wasi-experimental-io-devices",
|
||||||
"lib/wasi-tests",
|
|
||||||
"lib/emscripten-tests",
|
"lib/emscripten-tests",
|
||||||
"lib/middleware-common-tests",
|
|
||||||
"lib/interface-types",
|
"lib/interface-types",
|
||||||
"examples/parallel",
|
"examples/parallel",
|
||||||
"examples/plugin-for-example",
|
"examples/plugin-for-example",
|
||||||
"examples/parallel-guest",
|
"examples/parallel-guest",
|
||||||
|
"tests/generate-wasi-tests",
|
||||||
]
|
]
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
wabt = "0.9.1"
|
wabt = "0.9.1"
|
||||||
|
generate-wasi-tests = { path = "tests/generate-wasi-tests" }
|
||||||
glob = "0.3"
|
glob = "0.3"
|
||||||
rustc_version = "0.2"
|
rustc_version = "0.2"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
criterion = "0.3"
|
||||||
|
glob = "0.3"
|
||||||
serde = { version = "1", features = ["derive"] } # used by the plugin example
|
serde = { version = "1", features = ["derive"] } # used by the plugin example
|
||||||
typetag = "0.1" # used by the plugin example
|
typetag = "0.1" # used by the plugin example
|
||||||
|
wabt = "0.9.1"
|
||||||
|
wasmer-dev-utils = { path = "lib/dev-utils" }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["fast-tests", "wasi", "backend-cranelift", "wabt"]
|
default = ["fast-tests", "wasi", "backend-cranelift", "wabt"]
|
||||||
@ -95,18 +94,15 @@ backend-cranelift = [
|
|||||||
"wasmer-clif-backend/generate-debug-information",
|
"wasmer-clif-backend/generate-debug-information",
|
||||||
"wasmer-runtime-core/generate-debug-information",
|
"wasmer-runtime-core/generate-debug-information",
|
||||||
"wasmer-runtime/cranelift",
|
"wasmer-runtime/cranelift",
|
||||||
"wasmer-middleware-common-tests/clif",
|
|
||||||
]
|
]
|
||||||
backend-llvm = [
|
backend-llvm = [
|
||||||
"wasmer-llvm-backend",
|
"wasmer-llvm-backend",
|
||||||
"wasmer-runtime/llvm",
|
"wasmer-runtime/llvm",
|
||||||
"wasmer-middleware-common-tests/llvm",
|
|
||||||
"wasmer-runtime-core/generate-debug-information-no-export-symbols"
|
"wasmer-runtime-core/generate-debug-information-no-export-symbols"
|
||||||
]
|
]
|
||||||
backend-singlepass = [
|
backend-singlepass = [
|
||||||
"wasmer-singlepass-backend",
|
"wasmer-singlepass-backend",
|
||||||
"wasmer-runtime/singlepass",
|
"wasmer-runtime/singlepass",
|
||||||
"wasmer-middleware-common-tests/singlepass",
|
|
||||||
]
|
]
|
||||||
wasi = ["wasmer-wasi"]
|
wasi = ["wasmer-wasi"]
|
||||||
experimental-io-devices = ["wasmer-wasi-experimental-io-devices"]
|
experimental-io-devices = ["wasmer-wasi-experimental-io-devices"]
|
||||||
@ -118,4 +114,4 @@ crate-type = ["bin"]
|
|||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "callback"
|
name = "callback"
|
||||||
crate-type = ["bin"]
|
crate-type = ["bin"]
|
@ -133,7 +133,7 @@ static WAT_GAS: &'static str = r#"
|
|||||||
(elem (i32.const 0) $f2))
|
(elem (i32.const 0) $f2))
|
||||||
"#;
|
"#;
|
||||||
|
|
||||||
#[cfg(feature = "llvm")]
|
#[cfg(feature = "backend-llvm")]
|
||||||
fn get_compiler(limit: u64, metering: bool) -> impl Compiler {
|
fn get_compiler(limit: u64, metering: bool) -> impl Compiler {
|
||||||
use wasmer_llvm_backend::ModuleCodeGenerator;
|
use wasmer_llvm_backend::ModuleCodeGenerator;
|
||||||
use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler};
|
use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler};
|
||||||
@ -148,7 +148,7 @@ fn get_compiler(limit: u64, metering: bool) -> impl Compiler {
|
|||||||
c
|
c
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "singlepass")]
|
#[cfg(feature = "backend-singlepass")]
|
||||||
fn get_compiler(limit: u64, metering: bool) -> impl Compiler {
|
fn get_compiler(limit: u64, metering: bool) -> impl Compiler {
|
||||||
use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler};
|
use wasmer_runtime_core::codegen::{MiddlewareChain, StreamingCompiler};
|
||||||
use wasmer_singlepass_backend::ModuleCodeGenerator as SinglePassMCG;
|
use wasmer_singlepass_backend::ModuleCodeGenerator as SinglePassMCG;
|
||||||
@ -162,10 +162,14 @@ fn get_compiler(limit: u64, metering: bool) -> impl Compiler {
|
|||||||
c
|
c
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(feature = "llvm", feature = "clif", feature = "singlepass")))]
|
#[cfg(not(any(
|
||||||
|
feature = "backend-llvm",
|
||||||
|
feature = "backend-cranelift",
|
||||||
|
feature = "backend-singlepass"
|
||||||
|
)))]
|
||||||
compile_error!("compiler not specified, activate a compiler via features");
|
compile_error!("compiler not specified, activate a compiler via features");
|
||||||
|
|
||||||
#[cfg(feature = "clif")]
|
#[cfg(feature = "backend-cranelift")]
|
||||||
fn get_compiler(_limit: u64, metering: bool) -> impl Compiler {
|
fn get_compiler(_limit: u64, metering: bool) -> impl Compiler {
|
||||||
compile_error!("cranelift does not implement metering");
|
compile_error!("cranelift does not implement metering");
|
||||||
use wasmer_clif_backend::CraneliftCompiler;
|
use wasmer_clif_backend::CraneliftCompiler;
|
9
build.rs
Normal file
9
build.rs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
//! A kind of meta-build.rs that can be configured to do different things.
|
||||||
|
//!
|
||||||
|
//! Please try to keep this file as clean as possible.
|
||||||
|
|
||||||
|
use generate_wasi_tests;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
generate_wasi_tests::build();
|
||||||
|
}
|
@ -1,15 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "api-tests"
|
|
||||||
version = "0.16.2"
|
|
||||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
|
||||||
edition = "2018"
|
|
||||||
license = "MIT"
|
|
||||||
publish = false
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
wasmer = { version = "0.16.2", path = "../api" }
|
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
wabt = "0.9.1"
|
|
@ -1 +0,0 @@
|
|||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "wasmer-llvm-backend-tests"
|
|
||||||
version = "0.10.2"
|
|
||||||
authors = ["Nick Lewycky <nick@wasmer.io>"]
|
|
||||||
license = "MIT"
|
|
||||||
edition = "2018"
|
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
wabt = "0.9.1"
|
|
||||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.16.2" }
|
|
||||||
wasmer-runtime = { path = "../runtime", version = "0.16.2" }
|
|
||||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.16.2", features = ["test"] }
|
|
||||||
|
|
||||||
[features]
|
|
@ -1,17 +0,0 @@
|
|||||||
#![deny(
|
|
||||||
dead_code,
|
|
||||||
nonstandard_style,
|
|
||||||
unused_imports,
|
|
||||||
unused_mut,
|
|
||||||
unused_variables,
|
|
||||||
unused_unsafe,
|
|
||||||
unreachable_patterns
|
|
||||||
)]
|
|
||||||
|
|
||||||
pub use wabt::wat2wasm;
|
|
||||||
use wasmer_llvm_backend::LLVMCompiler;
|
|
||||||
use wasmer_runtime_core::backend::Compiler;
|
|
||||||
|
|
||||||
pub fn get_compiler() -> impl Compiler {
|
|
||||||
LLVMCompiler::new()
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "wasmer-middleware-common-tests"
|
|
||||||
version = "0.16.2"
|
|
||||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
|
||||||
edition = "2018"
|
|
||||||
repository = "https://github.com/wasmerio/wasmer"
|
|
||||||
license = "MIT"
|
|
||||||
publish = false
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.16.2" }
|
|
||||||
wasmer-middleware-common = { path = "../middleware-common", version = "0.16.2" }
|
|
||||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.16.2", optional = true }
|
|
||||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.16.2", features = ["test"], optional = true }
|
|
||||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.16.2", optional = true }
|
|
||||||
|
|
||||||
[features]
|
|
||||||
clif = ["wasmer-clif-backend"]
|
|
||||||
llvm = ["wasmer-llvm-backend"]
|
|
||||||
singlepass = ["wasmer-singlepass-backend"]
|
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
wabt = "0.9.1"
|
|
||||||
criterion = "0.3"
|
|
||||||
|
|
||||||
[[bench]]
|
|
||||||
name = "metering_benchmark"
|
|
||||||
harness = false
|
|
@ -1,21 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "wasmer-runtime-core-tests"
|
|
||||||
version = "0.16.2"
|
|
||||||
description = "Tests for the Wasmer runtime core crate"
|
|
||||||
license = "MIT"
|
|
||||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
|
||||||
edition = "2018"
|
|
||||||
publish = false
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
wabt = "0.9.1"
|
|
||||||
wasmer-runtime-core = { path = "../runtime-core", version = "0.16.2" }
|
|
||||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.16.2", optional = true }
|
|
||||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.16.2", optional = true }
|
|
||||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.16.2", features = ["test"], optional = true }
|
|
||||||
|
|
||||||
[features]
|
|
||||||
default = ["backend-cranelift"]
|
|
||||||
backend-cranelift = ["wasmer-clif-backend"]
|
|
||||||
backend-singlepass = ["wasmer-singlepass-backend"]
|
|
||||||
backend-llvm = ["wasmer-llvm-backend"]
|
|
@ -1,30 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "wasmer-wasi-tests"
|
|
||||||
version = "0.16.2"
|
|
||||||
description = "Tests for our WASI implementation"
|
|
||||||
license = "MIT"
|
|
||||||
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
|
||||||
edition = "2018"
|
|
||||||
publish = false
|
|
||||||
build = "build/mod.rs"
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
# We set default features to false to be able to use the singlepass backend properly
|
|
||||||
wasmer-runtime = { path = "../runtime", version = "0.16.2", default-features = false }
|
|
||||||
wasmer-wasi = { path = "../wasi", version = "0.16.2" }
|
|
||||||
# hack to get tests to work
|
|
||||||
wasmer-clif-backend = { path = "../clif-backend", version = "0.16.2", optional = true}
|
|
||||||
wasmer-singlepass-backend = { path = "../singlepass-backend", version = "0.16.2", optional = true }
|
|
||||||
wasmer-llvm-backend = { path = "../llvm-backend", version = "0.16.2", features = ["test"], optional = true }
|
|
||||||
|
|
||||||
[build-dependencies]
|
|
||||||
glob = "0.3"
|
|
||||||
tempfile = "3"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
|
||||||
wasmer-dev-utils = { path = "../dev-utils", version = "0.16.2"}
|
|
||||||
|
|
||||||
[features]
|
|
||||||
clif = ["wasmer-clif-backend", "wasmer-runtime/default-backend-cranelift"]
|
|
||||||
singlepass = ["wasmer-singlepass-backend", "wasmer-runtime/default-backend-singlepass"]
|
|
||||||
llvm = ["wasmer-llvm-backend", "wasmer-runtime/default-backend-llvm"]
|
|
@ -1,19 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[ignore]
|
|
||||||
fn test_snapshot1_close_preopen_fd() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/close_preopen_fd.wasm",
|
|
||||||
"snapshot1_close_preopen_fd",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
"hamlet".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/close_preopen_fd.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[ignore]
|
|
||||||
fn test_snapshot1_fd_allocate() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/fd_allocate.wasm",
|
|
||||||
"snapshot1_fd_allocate",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/temp")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/fd_allocate.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_snapshot1_fd_append() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/fd_append.wasm",
|
|
||||||
"snapshot1_fd_append",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/temp")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/fd_append.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[ignore]
|
|
||||||
fn test_snapshot1_fd_close() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/fd_close.wasm",
|
|
||||||
"snapshot1_fd_close",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/fd_close.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[ignore]
|
|
||||||
fn test_snapshot1_fd_pread() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/fd_pread.wasm",
|
|
||||||
"snapshot1_fd_pread",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/fd_pread.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[ignore]
|
|
||||||
fn test_snapshot1_fd_read() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/fd_read.wasm",
|
|
||||||
"snapshot1_fd_read",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/fd_read.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_snapshot1_fd_sync() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/fd_sync.wasm",
|
|
||||||
"snapshot1_fd_sync",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/temp")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/fd_sync.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_snapshot1_fseek() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/fseek.wasm",
|
|
||||||
"snapshot1_fseek",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/fseek.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_snapshot1_mapdir() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/mapdir.wasm",
|
|
||||||
"snapshot1_mapdir",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/mapdir.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_snapshot1_path_link() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/path_link.wasm",
|
|
||||||
"snapshot1_path_link",
|
|
||||||
vec![],
|
|
||||||
vec![
|
|
||||||
(
|
|
||||||
"act5".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet/act5")
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"temp".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/temp")
|
|
||||||
),
|
|
||||||
],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/path_link.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_snapshot1_path_rename() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/path_rename.wasm",
|
|
||||||
"snapshot1_path_rename",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
"temp".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/temp")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/path_rename.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_snapshot1_path_symlink() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/path_symlink.wasm",
|
|
||||||
"snapshot1_path_symlink",
|
|
||||||
vec![],
|
|
||||||
vec![
|
|
||||||
(
|
|
||||||
"temp".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/temp")
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"hamlet".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),
|
|
||||||
],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/path_symlink.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
#[ignore]
|
|
||||||
fn test_snapshot1_poll_oneoff() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/poll_oneoff.wasm",
|
|
||||||
"snapshot1_poll_oneoff",
|
|
||||||
vec![],
|
|
||||||
vec![
|
|
||||||
(
|
|
||||||
"hamlet".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"temp".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/temp")
|
|
||||||
),
|
|
||||||
],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/poll_oneoff.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_snapshot1_readlink() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/readlink.wasm",
|
|
||||||
"snapshot1_readlink",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/readlink.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_snapshot1_wasi_sees_virtual_root() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/wasi_sees_virtual_root.wasm",
|
|
||||||
"snapshot1_wasi_sees_virtual_root",
|
|
||||||
vec![],
|
|
||||||
vec![
|
|
||||||
(
|
|
||||||
"act1".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet/act1")
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"act2".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet/act2")
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"act1-again".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet/act1")
|
|
||||||
),
|
|
||||||
],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/wasi_sees_virtual_root.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_snapshot1_writing() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/snapshot1/writing.wasm",
|
|
||||||
"snapshot1_writing",
|
|
||||||
vec![],
|
|
||||||
vec![
|
|
||||||
(
|
|
||||||
"act1".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet/act1")
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"act2".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet/act2")
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"act1-again".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet/act1")
|
|
||||||
),
|
|
||||||
],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/writing.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_close_preopen_fd() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/close_preopen_fd.wasm",
|
|
||||||
"unstable_close_preopen_fd",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
"hamlet".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/close_preopen_fd.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_fd_allocate() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/fd_allocate.wasm",
|
|
||||||
"unstable_fd_allocate",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/temp")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/fd_allocate.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_fd_append() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/fd_append.wasm",
|
|
||||||
"unstable_fd_append",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/temp")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/fd_append.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_fd_close() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/fd_close.wasm",
|
|
||||||
"unstable_fd_close",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/fd_close.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_fd_pread() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/fd_pread.wasm",
|
|
||||||
"unstable_fd_pread",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/fd_pread.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_fd_read() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/fd_read.wasm",
|
|
||||||
"unstable_fd_read",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/fd_read.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_fd_sync() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/fd_sync.wasm",
|
|
||||||
"unstable_fd_sync",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/temp")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/fd_sync.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_fseek() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/fseek.wasm",
|
|
||||||
"unstable_fseek",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/fseek.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_mapdir() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/mapdir.wasm",
|
|
||||||
"unstable_mapdir",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/mapdir.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_path_link() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/path_link.wasm",
|
|
||||||
"unstable_path_link",
|
|
||||||
vec![],
|
|
||||||
vec![
|
|
||||||
(
|
|
||||||
"act5".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet/act5")
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"temp".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/temp")
|
|
||||||
),
|
|
||||||
],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/path_link.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_path_rename() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/path_rename.wasm",
|
|
||||||
"unstable_path_rename",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
"temp".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/temp")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/path_rename.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_path_symlink() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/path_symlink.wasm",
|
|
||||||
"unstable_path_symlink",
|
|
||||||
vec![],
|
|
||||||
vec![
|
|
||||||
(
|
|
||||||
"temp".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/temp")
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"hamlet".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),
|
|
||||||
],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/path_symlink.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_poll_oneoff() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/poll_oneoff.wasm",
|
|
||||||
"unstable_poll_oneoff",
|
|
||||||
vec![],
|
|
||||||
vec![
|
|
||||||
(
|
|
||||||
"hamlet".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"temp".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/temp")
|
|
||||||
),
|
|
||||||
],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/poll_oneoff.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_readlink() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/readlink.wasm",
|
|
||||||
"unstable_readlink",
|
|
||||||
vec![],
|
|
||||||
vec![(
|
|
||||||
".".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
|
|
||||||
),],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/readlink.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_wasi_sees_virtual_root() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/wasi_sees_virtual_root.wasm",
|
|
||||||
"unstable_wasi_sees_virtual_root",
|
|
||||||
vec![],
|
|
||||||
vec![
|
|
||||||
(
|
|
||||||
"act1".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet/act1")
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"act2".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet/act2")
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"act1-again".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet/act1")
|
|
||||||
),
|
|
||||||
],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/wasi_sees_virtual_root.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
// !!! THIS IS A GENERATED FILE !!!
|
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_unstable_writing() {
|
|
||||||
assert_wasi_output!(
|
|
||||||
"../../wasitests/unstable/writing.wasm",
|
|
||||||
"unstable_writing",
|
|
||||||
vec![],
|
|
||||||
vec![
|
|
||||||
(
|
|
||||||
"act1".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet/act1")
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"act2".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet/act2")
|
|
||||||
),
|
|
||||||
(
|
|
||||||
"act1-again".to_string(),
|
|
||||||
::std::path::PathBuf::from("wasitests/test_fs/hamlet/act1")
|
|
||||||
),
|
|
||||||
],
|
|
||||||
vec![],
|
|
||||||
"../../wasitests/writing.out"
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,5 +1,7 @@
|
|||||||
|
mod runtime_core_tests;
|
||||||
|
|
||||||
|
use runtime_core_tests::{get_compiler, wat2wasm};
|
||||||
use wasmer_runtime_core::{compile_with, imports};
|
use wasmer_runtime_core::{compile_with, imports};
|
||||||
use wasmer_runtime_core_tests::{get_compiler, wat2wasm};
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn exception_handling_works() {
|
fn exception_handling_works() {
|
21
tests/generate-wasi-tests/Cargo.toml
Normal file
21
tests/generate-wasi-tests/Cargo.toml
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
[package]
|
||||||
|
name = "generate-wasi-tests"
|
||||||
|
version = "0.16.2"
|
||||||
|
description = "Tests for our WASI implementation"
|
||||||
|
license = "MIT"
|
||||||
|
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
|
||||||
|
edition = "2018"
|
||||||
|
publish = false
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
glob = "0.3"
|
||||||
|
tempfile = "3"
|
||||||
|
# We set default features to false to be able to use the singlepass backend properly
|
||||||
|
|
||||||
|
#[dev-dependencies]
|
||||||
|
#wasmer-dev-utils = { path = "../../lib/dev-utils", version = "0.16.2"}
|
||||||
|
|
||||||
|
#[features]
|
||||||
|
#clif = ["wasmer-clif-backend", "wasmer-runtime/default-backend-cranelift"]
|
||||||
|
#singlepass = ["wasmer-singlepass-backend", "wasmer-runtime/default-backend-singlepass"]
|
||||||
|
#llvm = ["wasmer-llvm-backend", "wasmer-runtime/default-backend-llvm"]
|
@ -1,14 +1,19 @@
|
|||||||
use std::env;
|
use std::env;
|
||||||
|
|
||||||
mod set_up_toolchain;
|
pub mod set_up_toolchain;
|
||||||
mod util;
|
pub mod util;
|
||||||
mod wasi_version;
|
pub mod wasi_version;
|
||||||
mod wasitests;
|
pub mod wasitests;
|
||||||
|
|
||||||
static WASITESTS_ENV_VAR: &str = "WASM_WASI_GENERATE_WASITESTS";
|
static WASITESTS_ENV_VAR: &str = "WASM_WASI_GENERATE_WASITESTS";
|
||||||
static WASITESTS_SET_UP_TOOLCHAIN: &str = "WASM_WASI_SET_UP_TOOLCHAIN";
|
static WASITESTS_SET_UP_TOOLCHAIN: &str = "WASM_WASI_SET_UP_TOOLCHAIN";
|
||||||
|
static WASITESTS_GENERATE_ALL: &str = "WASI_TEST_GENERATE_ALL";
|
||||||
|
|
||||||
fn main() {
|
pub fn build() {
|
||||||
|
//println!("cargo:rerun-if-changed=tests/wasi_test_resources/*.rs");
|
||||||
|
println!("cargo:rerun-if-env-changed={}", WASITESTS_ENV_VAR);
|
||||||
|
println!("cargo:rerun-if-env-changed={}", WASITESTS_SET_UP_TOOLCHAIN);
|
||||||
|
println!("cargo:rerun-if-env-changed={}", WASITESTS_GENERATE_ALL);
|
||||||
let do_all_wasi_tests = util::should_operate_on_all_wasi_tests();
|
let do_all_wasi_tests = util::should_operate_on_all_wasi_tests();
|
||||||
if env::var(WASITESTS_SET_UP_TOOLCHAIN).unwrap_or("0".to_string()) == "1" {
|
if env::var(WASITESTS_SET_UP_TOOLCHAIN).unwrap_or("0".to_string()) == "1" {
|
||||||
set_up_toolchain::set_it_up(do_all_wasi_tests);
|
set_up_toolchain::set_it_up(do_all_wasi_tests);
|
@ -1,5 +1,5 @@
|
|||||||
use crate::util;
|
use super::util;
|
||||||
use crate::wasi_version::*;
|
use super::wasi_version::*;
|
||||||
|
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
@ -15,12 +15,12 @@ use std::fs::File;
|
|||||||
use std::io::prelude::*;
|
use std::io::prelude::*;
|
||||||
use std::io::{self, BufReader};
|
use std::io::{self, BufReader};
|
||||||
|
|
||||||
use crate::util;
|
use super::util;
|
||||||
use crate::wasi_version::*;
|
use super::wasi_version::*;
|
||||||
|
|
||||||
static BANNER: &str = "// !!! THIS IS A GENERATED FILE !!!
|
static BANNER: &str = "// !!! THIS IS A GENERATED FILE !!!
|
||||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
||||||
// Files autogenerated with cargo build (build/wasitests.rs).\n";
|
// Files autogenerated with cargo build.\n";
|
||||||
|
|
||||||
/// Compile and execute the test file as native code, saving the results to be
|
/// Compile and execute the test file as native code, saving the results to be
|
||||||
/// compared against later.
|
/// compared against later.
|
||||||
@ -56,12 +56,19 @@ fn generate_native_output(temp_dir: &Path, file: &str, normalized_name: &str) ->
|
|||||||
fs::set_permissions(&executable_path, perm)?;
|
fs::set_permissions(&executable_path, perm)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
println!(
|
||||||
|
"Executing native program at {}",
|
||||||
|
executable_path.to_string_lossy()
|
||||||
|
);
|
||||||
|
// workspace root
|
||||||
|
const EXECUTE_DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../..");
|
||||||
let result = Command::new(&executable_path)
|
let result = Command::new(&executable_path)
|
||||||
|
.current_dir(EXECUTE_DIR)
|
||||||
.output()
|
.output()
|
||||||
.expect("Failed to execute native program");
|
.expect("Failed to execute native program");
|
||||||
util::print_info_on_error(&result, "NATIVE PROGRAM FAILED");
|
util::print_info_on_error(&result, "NATIVE PROGRAM FAILED");
|
||||||
|
|
||||||
let mut output_path = executable_path.clone();
|
let mut output_path = PathBuf::from(file);
|
||||||
output_path.set_extension("out");
|
output_path.set_extension("out");
|
||||||
|
|
||||||
println!("Writing output to {}", output_path.to_string_lossy());
|
println!("Writing output to {}", output_path.to_string_lossy());
|
||||||
@ -207,26 +214,26 @@ fn generate_test_file(
|
|||||||
#[test]{ignore}
|
#[test]{ignore}
|
||||||
fn test_{test_name}() {{
|
fn test_{test_name}() {{
|
||||||
assert_wasi_output!(
|
assert_wasi_output!(
|
||||||
\"../../{module_path}\",
|
\"{module_path}\",
|
||||||
\"{test_name}\",
|
\"{test_name}\",
|
||||||
{dir_args},
|
{dir_args},
|
||||||
{mapdir_args},
|
{mapdir_args},
|
||||||
{envvar_args},
|
{envvar_args},
|
||||||
\"../../{test_output_path}\"
|
\"{test_output_path}\"
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
",
|
",
|
||||||
banner = BANNER,
|
banner = BANNER,
|
||||||
ignore = ignored,
|
ignore = ignored,
|
||||||
module_path = wasm_out_name,
|
module_path = format!("../wasi_test_resources/{}.wasm", wasm_out_name),
|
||||||
test_name = &test_name,
|
test_name = &test_name,
|
||||||
test_output_path = format!("wasitests/{}.out", rs_module_name),
|
test_output_path = format!("../wasi_test_resources/{}.out", rs_module_name),
|
||||||
dir_args = dir_args,
|
dir_args = dir_args,
|
||||||
mapdir_args = mapdir_args,
|
mapdir_args = mapdir_args,
|
||||||
envvar_args = envvar_args
|
envvar_args = envvar_args
|
||||||
);
|
);
|
||||||
let rust_test_filepath = format!(
|
let rust_test_filepath = format!(
|
||||||
concat!(env!("CARGO_MANIFEST_DIR"), "/tests/wasitests/{}.rs"),
|
concat!(env!("CARGO_MANIFEST_DIR"), "/../wasitests/{}.rs"),
|
||||||
&test_name,
|
&test_name,
|
||||||
);
|
);
|
||||||
fs::write(&rust_test_filepath, contents.as_bytes())?;
|
fs::write(&rust_test_filepath, contents.as_bytes())?;
|
||||||
@ -252,18 +259,21 @@ fn compile(
|
|||||||
};
|
};
|
||||||
let base_dir = Path::new(file).parent().unwrap();
|
let base_dir = Path::new(file).parent().unwrap();
|
||||||
generate_native_output(temp_dir, &file, &rs_mod_name).expect("Generate native output");
|
generate_native_output(temp_dir, &file, &rs_mod_name).expect("Generate native output");
|
||||||
let mut out = vec![];
|
|
||||||
|
|
||||||
for &version in wasi_versions {
|
wasi_versions
|
||||||
let wasm_out_path = compile_wasm_for_version(temp_dir, file, base_dir, &rs_mod_name, version)
|
.into_iter()
|
||||||
.expect(&format!("Could not compile Wasm to WASI version {:?}, perhaps you need to install the `{}` rust toolchain", version, version.get_compiler_toolchain()));
|
.map(|&version| {
|
||||||
let wasm_out_name = wasm_out_path.to_string_lossy();
|
compile_wasm_for_version(temp_dir, file, base_dir, &rs_mod_name, version)
|
||||||
let test_mod = generate_test_file(file, &rs_mod_name, &wasm_out_name, version, ignores)
|
.expect(&format!("Could not compile Wasm to WASI version {:?}, perhaps you need to install the `{}` rust toolchain", version, version.get_compiler_toolchain()));
|
||||||
.expect(&format!("generate test file {}", &rs_mod_name));
|
let wasm_out_relative_path = {
|
||||||
out.push(test_mod);
|
let base_path = PathBuf::from(version.get_directory_name());
|
||||||
}
|
base_path.join(&rs_mod_name)
|
||||||
|
};
|
||||||
|
let wasm_out_name = wasm_out_relative_path.to_string_lossy();
|
||||||
|
|
||||||
out
|
generate_test_file(file, &rs_mod_name, &wasm_out_name, version, ignores)
|
||||||
|
.expect(&format!("generate test file {}", &rs_mod_name))
|
||||||
|
}).collect::<Vec<String>>()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run_prelude(should_gen_all: bool) -> &'static [WasiVersion] {
|
fn run_prelude(should_gen_all: bool) -> &'static [WasiVersion] {
|
||||||
@ -284,15 +294,16 @@ fn run_prelude(should_gen_all: bool) -> &'static [WasiVersion] {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const WASI_TEST_SRC_DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/../wasi_test_resources/*.rs");
|
||||||
pub fn build(should_gen_all: bool) {
|
pub fn build(should_gen_all: bool) {
|
||||||
let rust_test_modpath = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/wasitests/mod.rs");
|
let rust_test_modpath = concat!(env!("CARGO_MANIFEST_DIR"), "/../wasitests/mod.rs");
|
||||||
|
|
||||||
let mut modules: Vec<String> = Vec::new();
|
let mut modules: Vec<String> = Vec::new();
|
||||||
let wasi_versions = run_prelude(should_gen_all);
|
let wasi_versions = run_prelude(should_gen_all);
|
||||||
|
|
||||||
let temp_dir = tempfile::TempDir::new().unwrap();
|
let temp_dir = tempfile::TempDir::new().unwrap();
|
||||||
let ignores = read_ignore_list();
|
let ignores = read_ignore_list();
|
||||||
for entry in glob("wasitests/*.rs").unwrap() {
|
for entry in glob(WASI_TEST_SRC_DIR).unwrap() {
|
||||||
match entry {
|
match entry {
|
||||||
Ok(path) => {
|
Ok(path) => {
|
||||||
let test = path.to_str().unwrap();
|
let test = path.to_str().unwrap();
|
||||||
@ -333,8 +344,12 @@ pub fn build(should_gen_all: bool) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const IGNORE_LIST_PATH: &str = concat!(
|
||||||
|
env!("CARGO_MANIFEST_DIR"),
|
||||||
|
"/../wasi_test_resources/ignores.txt"
|
||||||
|
);
|
||||||
fn read_ignore_list() -> HashSet<String> {
|
fn read_ignore_list() -> HashSet<String> {
|
||||||
let f = File::open("wasitests/ignores.txt").unwrap();
|
let f = File::open(IGNORE_LIST_PATH).unwrap();
|
||||||
let f = BufReader::new(f);
|
let f = BufReader::new(f);
|
||||||
f.lines()
|
f.lines()
|
||||||
.filter_map(Result::ok)
|
.filter_map(Result::ok)
|
@ -1,3 +1,6 @@
|
|||||||
|
mod runtime_core_tests;
|
||||||
|
|
||||||
|
use runtime_core_tests::{get_compiler, wat2wasm};
|
||||||
use std::{convert::TryInto, sync::Arc};
|
use std::{convert::TryInto, sync::Arc};
|
||||||
use wasmer_runtime_core::{
|
use wasmer_runtime_core::{
|
||||||
compile_with,
|
compile_with,
|
||||||
@ -10,7 +13,6 @@ use wasmer_runtime_core::{
|
|||||||
units::Pages,
|
units::Pages,
|
||||||
vm, DynFunc, Instance,
|
vm, DynFunc, Instance,
|
||||||
};
|
};
|
||||||
use wasmer_runtime_core_tests::{get_compiler, wat2wasm};
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn new_api_works() {
|
fn new_api_works() {
|
@ -1,5 +1,23 @@
|
|||||||
|
#![cfg(all(feature = "backend-llvm", test))]
|
||||||
|
#![deny(
|
||||||
|
dead_code,
|
||||||
|
nonstandard_style,
|
||||||
|
unused_imports,
|
||||||
|
unused_mut,
|
||||||
|
unused_variables,
|
||||||
|
unused_unsafe,
|
||||||
|
unreachable_patterns
|
||||||
|
)]
|
||||||
|
|
||||||
|
use wabt::wat2wasm;
|
||||||
|
use wasmer_llvm_backend::LLVMCompiler;
|
||||||
|
use wasmer_runtime_core::backend::Compiler;
|
||||||
|
|
||||||
|
pub fn get_compiler() -> impl Compiler {
|
||||||
|
LLVMCompiler::new()
|
||||||
|
}
|
||||||
|
|
||||||
use wasmer_llvm_backend::{InkwellModule, LLVMBackendConfig, LLVMCallbacks};
|
use wasmer_llvm_backend::{InkwellModule, LLVMBackendConfig, LLVMCallbacks};
|
||||||
use wasmer_llvm_backend_tests::{get_compiler, wat2wasm};
|
|
||||||
use wasmer_runtime::{imports, CompilerConfig};
|
use wasmer_runtime::{imports, CompilerConfig};
|
||||||
use wasmer_runtime_core::{backend::BackendCompilerConfig, compile_with, compile_with_config};
|
use wasmer_runtime_core::{backend::BackendCompilerConfig, compile_with, compile_with_config};
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
#[cfg(all(test, any(feature = "singlepass", feature = "llvm")))]
|
#[cfg(all(test, any(feature = "backend-singlepass", feature = "backend-llvm")))]
|
||||||
mod tests {
|
mod tests {
|
||||||
use wabt::wat2wasm;
|
use wabt::wat2wasm;
|
||||||
|
|
||||||
@ -9,13 +9,13 @@ mod tests {
|
|||||||
use wasmer_runtime_core::state::CodeVersion;
|
use wasmer_runtime_core::state::CodeVersion;
|
||||||
use wasmer_runtime_core::{backend::Compiler, compile_with, imports, Func};
|
use wasmer_runtime_core::{backend::Compiler, compile_with, imports, Func};
|
||||||
|
|
||||||
#[cfg(feature = "llvm")]
|
#[cfg(feature = "backend-llvm")]
|
||||||
use wasmer_llvm_backend::ModuleCodeGenerator as MCG;
|
use wasmer_llvm_backend::ModuleCodeGenerator as MCG;
|
||||||
|
|
||||||
#[cfg(feature = "singlepass")]
|
#[cfg(feature = "backend-singlepass")]
|
||||||
use wasmer_singlepass_backend::ModuleCodeGenerator as MCG;
|
use wasmer_singlepass_backend::ModuleCodeGenerator as MCG;
|
||||||
|
|
||||||
#[cfg(feature = "clif")]
|
#[cfg(feature = "backend-cranelift")]
|
||||||
compile_error!("cranelift does not implement metering yet");
|
compile_error!("cranelift does not implement metering yet");
|
||||||
|
|
||||||
fn get_compiler(limit: u64) -> impl Compiler {
|
fn get_compiler(limit: u64) -> impl Compiler {
|
||||||
@ -27,7 +27,11 @@ mod tests {
|
|||||||
c
|
c
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(feature = "llvm", feature = "clif", feature = "singlepass")))]
|
#[cfg(not(any(
|
||||||
|
feature = "backend-llvm",
|
||||||
|
feature = "backend-cranelift",
|
||||||
|
feature = "backend-singlepass"
|
||||||
|
)))]
|
||||||
compile_error!("compiler not specified, activate a compiler via features");
|
compile_error!("compiler not specified, activate a compiler via features");
|
||||||
|
|
||||||
// Assemblyscript
|
// Assemblyscript
|
@ -4,6 +4,8 @@ use wasmer_wasi::{state::*, *};
|
|||||||
|
|
||||||
use std::ffi::c_void;
|
use std::ffi::c_void;
|
||||||
|
|
||||||
|
// TODO: fix this test!
|
||||||
|
#[ignore]
|
||||||
#[cfg(not(feature = "singlepass"))]
|
#[cfg(not(feature = "singlepass"))]
|
||||||
#[test]
|
#[test]
|
||||||
fn serializing_works() {
|
fn serializing_works() {
|
||||||
@ -15,7 +17,7 @@ fn serializing_works() {
|
|||||||
b"PATH=/bin".into_iter().cloned().collect(),
|
b"PATH=/bin".into_iter().cloned().collect(),
|
||||||
b"GOROOT=$HOME/.cargo/bin".into_iter().cloned().collect(),
|
b"GOROOT=$HOME/.cargo/bin".into_iter().cloned().collect(),
|
||||||
];
|
];
|
||||||
let wasm_binary = include_bytes!("../wasitests/unstable/fd_read.wasm");
|
let wasm_binary = include_bytes!("wasi_test_resources/unstable/fd_read.wasm");
|
||||||
let module = compile(&wasm_binary[..])
|
let module = compile(&wasm_binary[..])
|
||||||
.map_err(|e| format!("Can't compile module: {:?}", e))
|
.map_err(|e| format!("Can't compile module: {:?}", e))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -28,7 +30,7 @@ fn serializing_works() {
|
|||||||
vec![],
|
vec![],
|
||||||
vec![(
|
vec![(
|
||||||
".".to_string(),
|
".".to_string(),
|
||||||
std::path::PathBuf::from("wasitests/test_fs/hamlet"),
|
std::path::PathBuf::from("wasi_test_resources/test_fs/hamlet"),
|
||||||
)],
|
)],
|
||||||
);
|
);
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
// Args:
|
// Args:
|
||||||
// mapdir: hamlet:wasitests/test_fs/hamlet
|
// mapdir: hamlet:tests/wasi_test_resources/test_fs/hamlet
|
||||||
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
@ -1,5 +1,5 @@
|
|||||||
// Args:
|
// Args:
|
||||||
// mapdir: .:wasitests/test_fs/temp
|
// mapdir: .:tests/wasi_test_resources/test_fs/temp
|
||||||
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
#[cfg(target_os = "wasi")]
|
#[cfg(target_os = "wasi")]
|
@ -1,5 +1,5 @@
|
|||||||
// Args:
|
// Args:
|
||||||
// mapdir: .:wasitests/test_fs/temp
|
// mapdir: .:tests/wasi_test_resources/test_fs/temp
|
||||||
|
|
||||||
use std::fs::OpenOptions;
|
use std::fs::OpenOptions;
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
@ -11,7 +11,7 @@ static STR2: &str = "Goodbye, world!\n";
|
|||||||
fn main() {
|
fn main() {
|
||||||
let file = {
|
let file = {
|
||||||
#[cfg(not(target_os = "wasi"))]
|
#[cfg(not(target_os = "wasi"))]
|
||||||
let mut base = PathBuf::from("wasitests/test_fs/temp");
|
let mut base = PathBuf::from("tests/wasi_test_resources/test_fs/temp");
|
||||||
#[cfg(target_os = "wasi")]
|
#[cfg(target_os = "wasi")]
|
||||||
let mut base = PathBuf::from(".");
|
let mut base = PathBuf::from(".");
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
// Args:
|
// Args:
|
||||||
// mapdir: .:wasitests/test_fs/hamlet
|
// mapdir: .:tests/wasi_test_resources/test_fs/hamlet
|
||||||
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
#[cfg(target_os = "wasi")]
|
#[cfg(target_os = "wasi")]
|
||||||
@ -14,7 +14,7 @@ extern "C" {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[cfg(not(target_os = "wasi"))]
|
#[cfg(not(target_os = "wasi"))]
|
||||||
let mut base = PathBuf::from("wasitests/test_fs/hamlet");
|
let mut base = PathBuf::from("tests/wasi_test_resources/test_fs/hamlet");
|
||||||
#[cfg(target_os = "wasi")]
|
#[cfg(target_os = "wasi")]
|
||||||
let mut base = PathBuf::from(".");
|
let mut base = PathBuf::from(".");
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
// Args:
|
// Args:
|
||||||
// mapdir: .:wasitests/test_fs/hamlet
|
// mapdir: .:tests/wasi_test_resources/test_fs/hamlet
|
||||||
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
#[cfg(target_os = "wasi")]
|
#[cfg(target_os = "wasi")]
|
||||||
@ -45,7 +45,7 @@ fn pread(fd: u32, iovs: &[&mut [u8]], offset: u64) -> u32 {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[cfg(not(target_os = "wasi"))]
|
#[cfg(not(target_os = "wasi"))]
|
||||||
let mut base = PathBuf::from("wasitests/test_fs/hamlet");
|
let mut base = PathBuf::from("tests/wasi_test_resources/test_fs/hamlet");
|
||||||
#[cfg(target_os = "wasi")]
|
#[cfg(target_os = "wasi")]
|
||||||
let mut base = PathBuf::from(".");
|
let mut base = PathBuf::from(".");
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
// Args:
|
// Args:
|
||||||
// mapdir: .:wasitests/test_fs/hamlet
|
// mapdir: .:tests/wasi_test_resources/test_fs/hamlet
|
||||||
|
|
||||||
// this program is used in the pause/resume test
|
// this program is used in the pause/resume test
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ fn read(fd: u32, iovs: &[&mut [u8]]) -> u32 {
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[cfg(not(target_os = "wasi"))]
|
#[cfg(not(target_os = "wasi"))]
|
||||||
let mut base = PathBuf::from("wasitests/test_fs/hamlet");
|
let mut base = PathBuf::from("tests/wasi_test_resources/test_fs/hamlet");
|
||||||
#[cfg(target_os = "wasi")]
|
#[cfg(target_os = "wasi")]
|
||||||
let mut base = PathBuf::from(".");
|
let mut base = PathBuf::from(".");
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
// Args:
|
// Args:
|
||||||
// mapdir: .:wasitests/test_fs/temp
|
// mapdir: .:tests/wasi_test_resources/test_fs/temp
|
||||||
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
@ -1,3 +1,3 @@
|
|||||||
is dir: false
|
is dir: false
|
||||||
filetype: false true false
|
filetype: false true false
|
||||||
file info: 476
|
file info: 493
|
@ -5,8 +5,8 @@ use std::fs;
|
|||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut this_file =
|
let mut this_file = fs::File::open("tests/wasi_test_resources/file_metadata.rs")
|
||||||
fs::File::open("wasitests/file_metadata.rs").expect("could not find src file");
|
.expect("could not find src file");
|
||||||
let md = this_file.metadata().unwrap();
|
let md = this_file.metadata().unwrap();
|
||||||
println!("is dir: {}", md.is_dir());
|
println!("is dir: {}", md.is_dir());
|
||||||
let filetype = md.file_type();
|
let filetype = md.file_type();
|
@ -1,5 +1,5 @@
|
|||||||
// Args:
|
// Args:
|
||||||
// mapdir: .:wasitests/test_fs/hamlet
|
// mapdir: .:tests/wasi_test_resources/test_fs/hamlet
|
||||||
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io::{Read, Seek, SeekFrom};
|
use std::io::{Read, Seek, SeekFrom};
|
||||||
@ -7,7 +7,7 @@ use std::path::PathBuf;
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[cfg(not(target_os = "wasi"))]
|
#[cfg(not(target_os = "wasi"))]
|
||||||
let mut base = PathBuf::from("wasitests/test_fs/hamlet");
|
let mut base = PathBuf::from("tests/wasi_test_resources/test_fs/hamlet");
|
||||||
#[cfg(target_os = "wasi")]
|
#[cfg(target_os = "wasi")]
|
||||||
let mut base = PathBuf::from(".");
|
let mut base = PathBuf::from(".");
|
||||||
|
|
@ -1,11 +1,11 @@
|
|||||||
// Args:
|
// Args:
|
||||||
// mapdir: .:wasitests/test_fs/hamlet
|
// mapdir: .:tests/wasi_test_resources/test_fs/hamlet
|
||||||
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[cfg(not(target_os = "wasi"))]
|
#[cfg(not(target_os = "wasi"))]
|
||||||
std::env::set_current_dir("wasitests/test_fs/hamlet").unwrap();
|
std::env::set_current_dir("tests/wasi_test_resources/test_fs/hamlet").unwrap();
|
||||||
|
|
||||||
let read_dir = fs::read_dir(".").unwrap();
|
let read_dir = fs::read_dir(".").unwrap();
|
||||||
let mut out = vec![];
|
let mut out = vec![];
|
@ -1,6 +1,6 @@
|
|||||||
// Args:
|
// Args:
|
||||||
// mapdir: act5:wasitests/test_fs/hamlet/act5
|
// mapdir: act5:tests/wasi_test_resources/test_fs/hamlet/act5
|
||||||
// mapdir: temp:wasitests/test_fs/temp
|
// mapdir: temp:tests/wasi_test_resources/test_fs/temp
|
||||||
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io::Read;
|
use std::io::Read;
|
@ -1,5 +1,5 @@
|
|||||||
// Args:
|
// Args:
|
||||||
// mapdir: temp:wasitests/test_fs/temp
|
// mapdir: temp:tests/wasi_test_resources/test_fs/temp
|
||||||
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Write};
|
||||||
@ -7,7 +7,7 @@ use std::path::PathBuf;
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[cfg(not(target_os = "wasi"))]
|
#[cfg(not(target_os = "wasi"))]
|
||||||
let mut base = PathBuf::from("wasitests/test_fs");
|
let mut base = PathBuf::from("tests/wasi_test_resources/test_fs");
|
||||||
#[cfg(target_os = "wasi")]
|
#[cfg(target_os = "wasi")]
|
||||||
let mut base = PathBuf::from("/");
|
let mut base = PathBuf::from("/");
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
// Args:
|
// Args:
|
||||||
// mapdir: temp:wasitests/test_fs/temp
|
// mapdir: temp:tests/wasi_test_resources/test_fs/temp
|
||||||
// mapdir: hamlet:wasitests/test_fs/hamlet
|
// mapdir: hamlet:tests/wasi_test_resources/test_fs/hamlet
|
||||||
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io::{Read, Seek, SeekFrom};
|
use std::io::{Read, Seek, SeekFrom};
|
||||||
@ -8,7 +8,7 @@ use std::path::PathBuf;
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[cfg(not(target_os = "wasi"))]
|
#[cfg(not(target_os = "wasi"))]
|
||||||
let mut base = PathBuf::from("wasitests/test_fs");
|
let mut base = PathBuf::from("tests/wasi_test_resources/test_fs");
|
||||||
#[cfg(target_os = "wasi")]
|
#[cfg(target_os = "wasi")]
|
||||||
let mut base = PathBuf::from("/");
|
let mut base = PathBuf::from("/");
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
// Args:
|
// Args:
|
||||||
// mapdir: hamlet:wasitests/test_fs/hamlet
|
// mapdir: hamlet:tests/wasi_test_resources/test_fs/hamlet
|
||||||
// mapdir: temp:wasitests/test_fs/temp
|
// mapdir: temp:tests/wasi_test_resources/test_fs/temp
|
||||||
|
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::io::{Read, Seek, SeekFrom};
|
use std::io::{Read, Seek, SeekFrom};
|
||||||
@ -139,7 +139,7 @@ fn poll(fds: &[u32], read: &[bool], write: &[bool]) -> Result<Vec<__wasi_event_t
|
|||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[cfg(not(target_os = "wasi"))]
|
#[cfg(not(target_os = "wasi"))]
|
||||||
let mut base = PathBuf::from("wasitests/test_fs");
|
let mut base = PathBuf::from("tests/wasi_test_resources/test_fs");
|
||||||
#[cfg(target_os = "wasi")]
|
#[cfg(target_os = "wasi")]
|
||||||
let mut base = PathBuf::from("/");
|
let mut base = PathBuf::from("/");
|
||||||
|
|
@ -5,7 +5,8 @@ use std::fs;
|
|||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut this_file = fs::File::open("wasitests/quine.rs").expect("could not find src file");
|
let mut this_file =
|
||||||
|
fs::File::open("tests/wasi_test_resources/quine.rs").expect("could not find src file");
|
||||||
let md = this_file.metadata().unwrap();
|
let md = this_file.metadata().unwrap();
|
||||||
let mut in_str = String::new();
|
let mut in_str = String::new();
|
||||||
this_file.read_to_string(&mut in_str).unwrap();
|
this_file.read_to_string(&mut in_str).unwrap();
|
@ -5,7 +5,8 @@ use std::fs;
|
|||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut this_file = fs::File::open("wasitests/quine.rs").expect("could not find src file");
|
let mut this_file =
|
||||||
|
fs::File::open("tests/wasi_test_resources/quine.rs").expect("could not find src file");
|
||||||
let md = this_file.metadata().unwrap();
|
let md = this_file.metadata().unwrap();
|
||||||
let mut in_str = String::new();
|
let mut in_str = String::new();
|
||||||
this_file.read_to_string(&mut in_str).unwrap();
|
this_file.read_to_string(&mut in_str).unwrap();
|
@ -1,10 +1,10 @@
|
|||||||
// Args:
|
// Args:
|
||||||
// mapdir: .:wasitests/test_fs/hamlet
|
// mapdir: .:tests/wasi_test_resources/test_fs/hamlet
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[cfg(not(target_os = "wasi"))]
|
#[cfg(not(target_os = "wasi"))]
|
||||||
std::env::set_current_dir("wasitests/test_fs/hamlet").unwrap();
|
std::env::set_current_dir("tests/wasi_test_resources/test_fs/hamlet").unwrap();
|
||||||
|
|
||||||
let sym_link_path = "bookmarks/2019-07-16";
|
let sym_link_path = "bookmarks/2019-07-16";
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user