mirror of
https://github.com/fluencelabs/wasmer
synced 2024-12-05 02:20:19 +00:00
Merge remote-tracking branch 'origin/master' into feature/singlepass-nan-cncl
This commit is contained in:
commit
5e40be48a1
@ -3,7 +3,9 @@
|
||||
## **[Unreleased]**
|
||||
|
||||
- [#1303](https://github.com/wasmerio/wasmer/pull/1303) NaN canonicalization for singlepass backend.
|
||||
- [#1305](https://github.com/wasmerio/wasmer/pull/1305) Handle panics from DynamicFunc.
|
||||
- [#1301](https://github.com/wasmerio/wasmer/pull/1301) Update supported stable Rust version to 1.41.1.
|
||||
- [#1300](https://github.com/wasmerio/wasmer/pull/1300) Add support for multiple versions of WASI tests: wasitests now test all versions of WASI.
|
||||
- [#1285](https://github.com/wasmerio/wasmer/pull/1285) Greatly improve errors in `wasmer-interface-types`
|
||||
- [#1283](https://github.com/wasmerio/wasmer/pull/1283) Workaround for floating point arguments and return values in `DynamicFunc`s.
|
||||
|
||||
|
5
Cargo.lock
generated
5
Cargo.lock
generated
@ -86,9 +86,9 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
||||
|
||||
[[package]]
|
||||
name = "blake3"
|
||||
version = "0.1.5"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "46080006c1505f12f64dd2a09264b343381ed3190fa02c8005d5d662ac571c63"
|
||||
checksum = "c58fbca3e5be3b7a3c24a5ec6976a6a464490528e8fee92896fe4ee2a40b10fb"
|
||||
dependencies = [
|
||||
"arrayref",
|
||||
"arrayvec 0.5.1",
|
||||
@ -2133,6 +2133,7 @@ name = "wasmer-wasi-tests"
|
||||
version = "0.16.2"
|
||||
dependencies = [
|
||||
"glob 0.3.0",
|
||||
"tempfile",
|
||||
"wasmer-clif-backend",
|
||||
"wasmer-dev-utils",
|
||||
"wasmer-llvm-backend",
|
||||
|
20
Makefile
20
Makefile
@ -1,4 +1,4 @@
|
||||
.PHONY: spectests emtests clean build install lint precommit docs examples
|
||||
.PHONY: spectests emtests clean build install lint precommit docs examples
|
||||
|
||||
# Generate files
|
||||
generate-spectests:
|
||||
@ -11,15 +11,31 @@ generate-emtests:
|
||||
&& echo "formatting" \
|
||||
&& cargo fmt
|
||||
|
||||
# To generate WASI tests you'll need to have the correct versions of the Rust nightly
|
||||
# toolchain installed, see `WasiVersion::get_compiler_toolchain` in
|
||||
# `lib/wasi-tests/build/wasi_version.rs`
|
||||
#
|
||||
# or run `make wasitests-setup-toolchain` or `make wasitests-setup-toolchain-all`
|
||||
generate-wasitests: wasitests-setup
|
||||
WASM_WASI_GENERATE_WASITESTS=1 cargo build -p wasmer-wasi-tests --release -vv \
|
||||
&& echo "formatting" \
|
||||
&& cargo fmt
|
||||
|
||||
generate-wasitests-all: wasitests-setup
|
||||
WASI_TEST_GENERATE_ALL=1 WASM_WASI_GENERATE_WASITESTS=1 cargo build -p wasmer-wasi-tests --release -vv \
|
||||
&& echo "formatting" \
|
||||
&& cargo fmt
|
||||
|
||||
spectests-generate: generate-spectests
|
||||
emtests-generate: generate-emtests
|
||||
wasitests-generate: generate-wasitests
|
||||
|
||||
wasitests-setup-toolchain: wasitests-setup
|
||||
WASITESTS_SET_UP_TOOLCHAIN=1 cargo build -p wasmer-wasi-tests --release -vv
|
||||
|
||||
wasitests-setup-toolchain-all: wasitests-setup
|
||||
WASI_TEST_GENERATE_ALL=1 WASITESTS_SET_UP_TOOLCHAIN=1 cargo build -p wasmer-wasi-tests --release -vv
|
||||
|
||||
generate: generate-spectests generate-emtests generate-wasitests
|
||||
|
||||
|
||||
@ -67,6 +83,8 @@ middleware: middleware-singlepass middleware-cranelift middleware-llvm
|
||||
|
||||
# Wasitests
|
||||
wasitests-setup:
|
||||
# force cargo to rerun the build.rs step
|
||||
touch lib/wasi-tests/build/mod.rs
|
||||
rm -rf lib/wasi-tests/wasitests/test_fs/temp
|
||||
mkdir -p lib/wasi-tests/wasitests/test_fs/temp
|
||||
|
||||
|
@ -77,6 +77,7 @@ fn imported_functions_forms(test: &dyn Fn(&Instance)) {
|
||||
(import "env" "callback_fn" (func $callback_fn (type $type)))
|
||||
(import "env" "callback_closure" (func $callback_closure (type $type)))
|
||||
(import "env" "callback_fn_dynamic" (func $callback_fn_dynamic (type $type)))
|
||||
(import "env" "callback_fn_dynamic_panic" (func $callback_fn_dynamic_panic (type $type)))
|
||||
(import "env" "callback_closure_dynamic_0" (func $callback_closure_dynamic_0))
|
||||
(import "env" "callback_closure_dynamic_1" (func $callback_closure_dynamic_1 (param i32) (result i32)))
|
||||
(import "env" "callback_closure_dynamic_2" (func $callback_closure_dynamic_2 (param i32 i64) (result i64)))
|
||||
@ -104,6 +105,10 @@ fn imported_functions_forms(test: &dyn Fn(&Instance)) {
|
||||
get_local 0
|
||||
call $callback_fn_dynamic)
|
||||
|
||||
(func (export "function_fn_dynamic_panic") (type $type)
|
||||
get_local 0
|
||||
call $callback_fn_dynamic_panic)
|
||||
|
||||
(func (export "function_closure_dynamic_0")
|
||||
call $callback_closure_dynamic_0)
|
||||
|
||||
@ -191,6 +196,12 @@ fn imported_functions_forms(test: &dyn Fn(&Instance)) {
|
||||
callback_fn_dynamic,
|
||||
),
|
||||
|
||||
// Polymorphic function that panics.
|
||||
"callback_fn_dynamic_panic" => DynamicFunc::new(
|
||||
Arc::new(FuncSig::new(vec![Type::I32], vec![Type::I32])),
|
||||
callback_fn_dynamic_panic,
|
||||
),
|
||||
|
||||
// Polymorphic closure “closures”.
|
||||
"callback_closure_dynamic_0" => DynamicFunc::new(
|
||||
Arc::new(FuncSig::new(vec![], vec![])),
|
||||
@ -325,6 +336,10 @@ fn callback_fn_dynamic(_: &mut vm::Ctx, inputs: &[Value]) -> Vec<Value> {
|
||||
}
|
||||
}
|
||||
|
||||
fn callback_fn_dynamic_panic(_: &mut vm::Ctx, _: &[Value]) -> Vec<Value> {
|
||||
panic!("test");
|
||||
}
|
||||
|
||||
fn callback_fn_with_vmctx(vmctx: &mut vm::Ctx, n: i32) -> Result<i32, ()> {
|
||||
let memory = vmctx.memory(0);
|
||||
let shift_: i32 = memory.view()[0].get();
|
||||
@ -357,6 +372,7 @@ macro_rules! test {
|
||||
test!(test_fn, function_fn(i32) -> i32, (1) == Ok(2));
|
||||
test!(test_closure, function_closure(i32) -> i32, (1) == Ok(2));
|
||||
test!(test_fn_dynamic, function_fn_dynamic(i32) -> i32, (1) == Ok(2));
|
||||
test!(test_fn_dynamic_panic, function_fn_dynamic_panic(i32) -> i32, (1) == Err(RuntimeError(Box::new("test"))));
|
||||
test!(
|
||||
test_closure_dynamic_0,
|
||||
function_closure_dynamic_0(()) -> (),
|
||||
|
@ -39,7 +39,7 @@ version = "0.11"
|
||||
[dependencies.serde-bench]
|
||||
version = "0.0.7"
|
||||
[dependencies.blake3]
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
[dependencies.digest]
|
||||
version = "0.8"
|
||||
|
||||
@ -47,7 +47,7 @@ version = "0.8"
|
||||
winapi = { version = "0.3", features = ["memoryapi"] }
|
||||
|
||||
[build-dependencies]
|
||||
blake3 = "0.1.0"
|
||||
blake3 = "0.2.0"
|
||||
rustc_version = "0.2"
|
||||
cc = "1.0"
|
||||
|
||||
|
@ -334,7 +334,14 @@ impl<'a> DynamicFunc<'a> {
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
(ctx.func)(vmctx, &args)
|
||||
match panic::catch_unwind(panic::AssertUnwindSafe(|| (ctx.func)(vmctx, &args))) {
|
||||
Ok(x) => x,
|
||||
Err(e) => {
|
||||
// At this point, there is an error that needs to be trapped.
|
||||
drop(args); // Release the Vec which will leak otherwise.
|
||||
(&*vmctx.module).runnable_module.do_early_trap(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
unsafe extern "C" fn enter_host_polymorphic_i(
|
||||
ctx: *const CallContext,
|
||||
|
@ -308,6 +308,44 @@ singlepass:skip:simd_binaryen.wast:* # SIMD not implemented
|
||||
|
||||
singlepass:skip:atomic.wast:*:*:aarch64 # Threads not yet supported on singlepass
|
||||
|
||||
singlepass:fail:address.wast:194:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:195:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:196:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:197:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:198:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:200:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:201:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:202:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:203:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:204:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:481:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:482:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:483:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:484:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:485:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:486:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:487:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:489:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:490:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:491:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:492:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:493:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:494:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:495:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:541:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:542:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:588:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:589:freebsd # AssertTrap - expected trap, got []
|
||||
singlepass:fail:linking.wast:137:freebsd # AssertTrap - expected trap, got RuntimeError
|
||||
singlepass:fail:linking.wast:139:freebsd # AssertTrap - expected trap, got RuntimeError
|
||||
singlepass:fail:linking.wast:142:freebsd # AssertTrap - expected trap, got RuntimeError
|
||||
singlepass:fail:linking.wast:144:freebsd # AssertTrap - expected trap, got RuntimeError
|
||||
singlepass:fail:linking.wast:147:freebsd # AssertTrap - expected trap, got RuntimeError
|
||||
singlepass:fail:linking.wast:149:freebsd # AssertTrap - expected trap, got RuntimeError
|
||||
singlepass:fail:linking.wast:185:freebsd # AssertTrap - expected trap, got RuntimeError
|
||||
singlepass:fail:linking.wast:187:freebsd # AssertTrap - expected trap, got RuntimeError
|
||||
singlepass:fail:linking.wast:388:freebsd # AssertReturn - Call failed RuntimeError: unknown error
|
||||
|
||||
singlepass:fail:address.wast:200:linux:x86_64 # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:201:linux:x86_64 # AssertTrap - expected trap, got []
|
||||
singlepass:fail:address.wast:202:linux:x86_64 # AssertTrap - expected trap, got []
|
||||
|
@ -19,6 +19,7 @@ wasmer-llvm-backend = { path = "../llvm-backend", version = "0.16.2", features =
|
||||
|
||||
[build-dependencies]
|
||||
glob = "0.3"
|
||||
tempfile = "3"
|
||||
|
||||
[dev-dependencies]
|
||||
wasmer-dev-utils = { path = "../dev-utils", version = "0.16.2"}
|
||||
|
@ -1,11 +1,20 @@
|
||||
use std::env;
|
||||
|
||||
mod set_up_toolchain;
|
||||
mod util;
|
||||
mod wasi_version;
|
||||
mod wasitests;
|
||||
|
||||
static WASITESTS_ENV_VAR: &str = "WASM_WASI_GENERATE_WASITESTS";
|
||||
static WASITESTS_SET_UP_TOOLCHAIN: &str = "WASM_WASI_SET_UP_TOOLCHAIN";
|
||||
|
||||
fn main() {
|
||||
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" {
|
||||
set_up_toolchain::set_it_up(do_all_wasi_tests);
|
||||
}
|
||||
|
||||
if env::var(WASITESTS_ENV_VAR).unwrap_or("0".to_string()) == "1" {
|
||||
wasitests::build();
|
||||
wasitests::build(do_all_wasi_tests);
|
||||
}
|
||||
}
|
||||
|
31
lib/wasi-tests/build/set_up_toolchain.rs
Normal file
31
lib/wasi-tests/build/set_up_toolchain.rs
Normal file
@ -0,0 +1,31 @@
|
||||
use crate::util;
|
||||
use crate::wasi_version::*;
|
||||
|
||||
use std::process::Command;
|
||||
|
||||
fn install_toolchain(toolchain_name: &str) {
|
||||
println!("Installing rustup toolchain: {}", toolchain_name);
|
||||
let rustup_out = Command::new("rustup")
|
||||
.arg("toolchain")
|
||||
.arg("install")
|
||||
.arg(toolchain_name)
|
||||
.output()
|
||||
.expect("Failed to install toolchain with rustup");
|
||||
util::print_info_on_error(&rustup_out, "TOOLCHAIN INSTALL FAILED");
|
||||
}
|
||||
|
||||
pub fn set_it_up(only_latest: bool) {
|
||||
println!("Setting up system to generate the WASI tests.");
|
||||
println!("WARNING: this may use a lot of disk space.");
|
||||
|
||||
let wasi_versions = if only_latest {
|
||||
println!("Only installing the toolchain for the latest WASI version");
|
||||
LATEST_WASI_VERSION
|
||||
} else {
|
||||
println!("Installing the toolchain for all WASI versions");
|
||||
ALL_WASI_VERSIONS
|
||||
};
|
||||
for wasi_version in wasi_versions {
|
||||
install_toolchain(wasi_version.get_compiler_toolchain());
|
||||
}
|
||||
}
|
22
lib/wasi-tests/build/util.rs
Normal file
22
lib/wasi-tests/build/util.rs
Normal file
@ -0,0 +1,22 @@
|
||||
pub fn print_info_on_error(output: &std::process::Output, context: &str) {
|
||||
if !output.status.success() {
|
||||
println!("{}", context);
|
||||
println!(
|
||||
"stdout:\n{}",
|
||||
std::str::from_utf8(&output.stdout[..]).unwrap()
|
||||
);
|
||||
eprintln!(
|
||||
"stderr:\n{}",
|
||||
std::str::from_utf8(&output.stderr[..]).unwrap()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether or not we should operate on all WASI tests or not
|
||||
pub fn should_operate_on_all_wasi_tests() -> bool {
|
||||
std::env::var("WASI_TEST_GENERATE_ALL")
|
||||
.ok()
|
||||
.and_then(|s| s.parse::<u32>().ok())
|
||||
.unwrap_or(0)
|
||||
== 1
|
||||
}
|
29
lib/wasi-tests/build/wasi_version.rs
Normal file
29
lib/wasi-tests/build/wasi_version.rs
Normal file
@ -0,0 +1,29 @@
|
||||
pub static ALL_WASI_VERSIONS: &[WasiVersion] = &[WasiVersion::Unstable, WasiVersion::Snapshot1];
|
||||
pub static LATEST_WASI_VERSION: &[WasiVersion] = &[WasiVersion::get_latest()];
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum WasiVersion {
|
||||
/// A.K.A. Snapshot0
|
||||
Unstable,
|
||||
Snapshot1,
|
||||
}
|
||||
|
||||
impl WasiVersion {
|
||||
pub const fn get_latest() -> Self {
|
||||
Self::Snapshot1
|
||||
}
|
||||
|
||||
pub fn get_compiler_toolchain(&self) -> &'static str {
|
||||
match self {
|
||||
WasiVersion::Unstable => "nightly-2019-09-13",
|
||||
WasiVersion::Snapshot1 => "nightly-2019-12-18",
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_directory_name(&self) -> &'static str {
|
||||
match self {
|
||||
WasiVersion::Unstable => "unstable",
|
||||
WasiVersion::Snapshot1 => "snapshot1",
|
||||
}
|
||||
}
|
||||
}
|
@ -8,111 +8,160 @@
|
||||
use glob::glob;
|
||||
use std::collections::HashSet;
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::Command;
|
||||
|
||||
use std::fs::File;
|
||||
use std::io::prelude::*;
|
||||
use std::io::BufReader;
|
||||
use std::io::{self, BufReader};
|
||||
|
||||
use crate::util;
|
||||
use crate::wasi_version::*;
|
||||
|
||||
static BANNER: &str = "// !!! THIS IS A GENERATED FILE !!!
|
||||
// ANY MANUAL EDITS MAY BE OVERWRITTEN AT ANY TIME
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).\n";
|
||||
|
||||
pub fn compile(file: &str, ignores: &HashSet<String>) -> Option<String> {
|
||||
let mut output_path = PathBuf::from(file);
|
||||
output_path.set_extension("out");
|
||||
|
||||
assert!(file.ends_with(".rs"));
|
||||
let normalized_name = {
|
||||
let mut nn = file.to_lowercase();
|
||||
nn.truncate(file.len() - 3);
|
||||
nn
|
||||
};
|
||||
|
||||
println!("Compiling program {} to native", file);
|
||||
/// Compile and execute the test file as native code, saving the results to be
|
||||
/// compared against later.
|
||||
///
|
||||
/// This function attempts to clean up its output after it executes it.
|
||||
fn generate_native_output(temp_dir: &Path, file: &str, normalized_name: &str) -> io::Result<()> {
|
||||
let executable_path = temp_dir.join(normalized_name);
|
||||
println!(
|
||||
"Compiling program {} to native at {}",
|
||||
file,
|
||||
executable_path.to_string_lossy()
|
||||
);
|
||||
let native_out = Command::new("rustc")
|
||||
.arg(file)
|
||||
.arg("-o")
|
||||
.arg(&normalized_name)
|
||||
.arg(&executable_path)
|
||||
.output()
|
||||
.expect("Failed to compile program to native code");
|
||||
print_info_on_error(&native_out, "COMPILATION FAILED");
|
||||
util::print_info_on_error(&native_out, "COMPILATION FAILED");
|
||||
|
||||
#[cfg(unix)]
|
||||
{
|
||||
use std::os::unix::fs::PermissionsExt;
|
||||
let normal_path = PathBuf::from(&normalized_name);
|
||||
let mut perm = normal_path
|
||||
let mut perm = executable_path
|
||||
.metadata()
|
||||
.expect("native executable")
|
||||
.permissions();
|
||||
perm.set_mode(0o766);
|
||||
fs::set_permissions(normal_path, perm).expect("set permissions");
|
||||
println!(
|
||||
"Setting execute permissions on {}",
|
||||
executable_path.to_string_lossy()
|
||||
);
|
||||
fs::set_permissions(&executable_path, perm)?;
|
||||
}
|
||||
let rs_module_name = {
|
||||
let temp = PathBuf::from(&normalized_name);
|
||||
temp.file_name().unwrap().to_string_lossy().to_string()
|
||||
};
|
||||
|
||||
let result = Command::new(&normalized_name)
|
||||
let result = Command::new(&executable_path)
|
||||
.output()
|
||||
.expect("Failed to execute native program");
|
||||
print_info_on_error(&result, "NATIVE PROGRAM FAILED");
|
||||
util::print_info_on_error(&result, "NATIVE PROGRAM FAILED");
|
||||
|
||||
std::fs::remove_file(&normalized_name).expect("could not delete executable");
|
||||
let wasm_out_name = format!("{}.wasm", &normalized_name);
|
||||
let mut output_path = executable_path.clone();
|
||||
output_path.set_extension("out");
|
||||
|
||||
let mut file_contents = String::new();
|
||||
{
|
||||
let mut file = std::fs::File::open(file).unwrap();
|
||||
file.read_to_string(&mut file_contents).unwrap();
|
||||
println!("Writing output to {}", output_path.to_string_lossy());
|
||||
fs::write(&output_path, result.stdout)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// compile the Wasm file for the given version of WASI
|
||||
///
|
||||
/// returns the path of where the wasm file is
|
||||
fn compile_wasm_for_version(
|
||||
temp_dir: &Path,
|
||||
file: &str,
|
||||
base_dir: &Path,
|
||||
rs_mod_name: &str,
|
||||
version: WasiVersion,
|
||||
) -> io::Result<PathBuf> {
|
||||
let out_dir = base_dir.join(version.get_directory_name());
|
||||
if !out_dir.exists() {
|
||||
fs::create_dir(&out_dir)?;
|
||||
}
|
||||
let wasm_out_name = {
|
||||
let mut wasm_out_name = out_dir.join(rs_mod_name);
|
||||
wasm_out_name.set_extension("wasm");
|
||||
wasm_out_name
|
||||
};
|
||||
println!("Reading contents from file `{}`", file);
|
||||
let file_contents: String = {
|
||||
let mut fc = String::new();
|
||||
let mut f = fs::OpenOptions::new().read(true).open(&file)?;
|
||||
f.read_to_string(&mut fc)?;
|
||||
fc
|
||||
};
|
||||
|
||||
let temp_wasi_rs_file_name = temp_dir.join(format!("wasi_modified_version_{}.rs", rs_mod_name));
|
||||
{
|
||||
let mut actual_file = std::fs::OpenOptions::new()
|
||||
let mut actual_file = fs::OpenOptions::new()
|
||||
.write(true)
|
||||
.truncate(true)
|
||||
.open(file)
|
||||
.unwrap();
|
||||
actual_file
|
||||
.write_all(format!("#![feature(wasi_ext)]\n{}", &file_contents).as_bytes())
|
||||
.create(true)
|
||||
.open(&temp_wasi_rs_file_name)
|
||||
.unwrap();
|
||||
actual_file.write_all(b"#![feature(wasi_ext)]\n").unwrap();
|
||||
actual_file.write_all(file_contents.as_bytes()).unwrap();
|
||||
}
|
||||
|
||||
println!(
|
||||
"Compiling wasm module `{}` with toolchain `{}`",
|
||||
&wasm_out_name.to_string_lossy(),
|
||||
version.get_compiler_toolchain()
|
||||
);
|
||||
let wasm_compilation_out = Command::new("rustc")
|
||||
.arg("+nightly")
|
||||
.arg(format!("+{}", version.get_compiler_toolchain()))
|
||||
.arg("--target=wasm32-wasi")
|
||||
.arg("-C")
|
||||
.arg("opt-level=z")
|
||||
.arg(file)
|
||||
.arg(&temp_wasi_rs_file_name)
|
||||
.arg("-o")
|
||||
.arg(&wasm_out_name)
|
||||
.output()
|
||||
.expect("Failed to compile program to native code");
|
||||
print_info_on_error(&wasm_compilation_out, "WASM COMPILATION");
|
||||
{
|
||||
let mut actual_file = std::fs::OpenOptions::new()
|
||||
.write(true)
|
||||
.truncate(true)
|
||||
.open(file)
|
||||
.unwrap();
|
||||
actual_file.write_all(file_contents.as_bytes()).unwrap();
|
||||
}
|
||||
.expect("Failed to compile program to wasm");
|
||||
util::print_info_on_error(&wasm_compilation_out, "WASM COMPILATION");
|
||||
println!(
|
||||
"Removing file `{}`",
|
||||
&temp_wasi_rs_file_name.to_string_lossy()
|
||||
);
|
||||
|
||||
// to prevent commiting huge binary blobs forever
|
||||
let wasm_strip_out = Command::new("wasm-strip")
|
||||
.arg(&wasm_out_name)
|
||||
.output()
|
||||
.expect("Failed to strip compiled wasm module");
|
||||
print_info_on_error(&wasm_strip_out, "STRIPPING WASM");
|
||||
util::print_info_on_error(&wasm_strip_out, "STRIPPING WASM");
|
||||
let wasm_opt_out = Command::new("wasm-opt")
|
||||
.arg("-Oz")
|
||||
.arg(&wasm_out_name)
|
||||
.arg("-o")
|
||||
.arg(&wasm_out_name)
|
||||
.output()
|
||||
.expect("Failed to optimize compiled wasm module with wasm-opt!");
|
||||
util::print_info_on_error(&wasm_opt_out, "OPTIMIZING WASM");
|
||||
|
||||
let ignored = if ignores.contains(&rs_module_name) {
|
||||
Ok(wasm_out_name)
|
||||
}
|
||||
|
||||
fn generate_test_file(
|
||||
file: &str,
|
||||
rs_module_name: &str,
|
||||
wasm_out_name: &str,
|
||||
version: WasiVersion,
|
||||
ignores: &HashSet<String>,
|
||||
) -> io::Result<String> {
|
||||
let test_name = format!("{}_{}", version.get_directory_name(), rs_module_name);
|
||||
let ignored = if ignores.contains(&test_name) || ignores.contains(rs_module_name) {
|
||||
"\n#[ignore]"
|
||||
} else {
|
||||
""
|
||||
};
|
||||
|
||||
let src_code = fs::read_to_string(file).expect("read src file");
|
||||
let src_code = fs::read_to_string(file)?;
|
||||
let args: Args = extract_args_from_source_file(&src_code).unwrap_or_default();
|
||||
|
||||
let mapdir_args = {
|
||||
@ -156,10 +205,10 @@ pub fn compile(file: &str, ignores: &HashSet<String>) -> Option<String> {
|
||||
"{banner}
|
||||
|
||||
#[test]{ignore}
|
||||
fn test_{rs_module_name}() {{
|
||||
fn test_{test_name}() {{
|
||||
assert_wasi_output!(
|
||||
\"../../{module_path}\",
|
||||
\"{rs_module_name}\",
|
||||
\"{test_name}\",
|
||||
{dir_args},
|
||||
{mapdir_args},
|
||||
{envvar_args},
|
||||
@ -170,39 +219,89 @@ fn test_{rs_module_name}() {{
|
||||
banner = BANNER,
|
||||
ignore = ignored,
|
||||
module_path = wasm_out_name,
|
||||
rs_module_name = rs_module_name,
|
||||
test_output_path = format!("{}.out", normalized_name),
|
||||
test_name = &test_name,
|
||||
test_output_path = format!("wasitests/{}.out", rs_module_name),
|
||||
dir_args = dir_args,
|
||||
mapdir_args = mapdir_args,
|
||||
envvar_args = envvar_args
|
||||
);
|
||||
let rust_test_filepath = format!(
|
||||
concat!(env!("CARGO_MANIFEST_DIR"), "/tests/{}.rs"),
|
||||
normalized_name,
|
||||
concat!(env!("CARGO_MANIFEST_DIR"), "/tests/wasitests/{}.rs"),
|
||||
&test_name,
|
||||
);
|
||||
fs::write(&rust_test_filepath, contents.as_bytes()).expect("writing test file");
|
||||
fs::write(&output_path, result.stdout).expect("writing output to file");
|
||||
fs::write(&rust_test_filepath, contents.as_bytes())?;
|
||||
|
||||
Some(rs_module_name)
|
||||
Ok(test_name)
|
||||
}
|
||||
|
||||
pub fn build() {
|
||||
/// Returns the a Vec of the test modules created
|
||||
fn compile(
|
||||
temp_dir: &Path,
|
||||
file: &str,
|
||||
ignores: &HashSet<String>,
|
||||
wasi_versions: &[WasiVersion],
|
||||
) -> Vec<String> {
|
||||
// TODO: hook up compile_wasm_for_version, etc with new args
|
||||
assert!(file.ends_with(".rs"));
|
||||
let rs_mod_name = {
|
||||
Path::new(&file.to_lowercase())
|
||||
.file_stem()
|
||||
.unwrap()
|
||||
.to_string_lossy()
|
||||
.to_string()
|
||||
};
|
||||
let base_dir = Path::new(file).parent().unwrap();
|
||||
generate_native_output(temp_dir, &file, &rs_mod_name).expect("Generate native output");
|
||||
let mut out = vec![];
|
||||
|
||||
for &version in wasi_versions {
|
||||
let wasm_out_path = compile_wasm_for_version(temp_dir, file, base_dir, &rs_mod_name, version)
|
||||
.expect(&format!("Could not compile Wasm to WASI version {:?}, perhaps you need to install the `{}` rust toolchain", version, version.get_compiler_toolchain()));
|
||||
let wasm_out_name = wasm_out_path.to_string_lossy();
|
||||
let test_mod = generate_test_file(file, &rs_mod_name, &wasm_out_name, version, ignores)
|
||||
.expect(&format!("generate test file {}", &rs_mod_name));
|
||||
out.push(test_mod);
|
||||
}
|
||||
|
||||
out
|
||||
}
|
||||
|
||||
fn run_prelude(should_gen_all: bool) -> &'static [WasiVersion] {
|
||||
if should_gen_all {
|
||||
println!(
|
||||
"Generating WASI tests for all versions of WASI. Run with WASI_TEST_GENERATE_ALL=0 to only generate the latest tests."
|
||||
);
|
||||
} else {
|
||||
println!(
|
||||
"Generating WASI tests for the latest version of WASI. Run with WASI_TEST_GENERATE_ALL=1 to generate all versions of the tests."
|
||||
);
|
||||
}
|
||||
|
||||
if should_gen_all {
|
||||
ALL_WASI_VERSIONS
|
||||
} else {
|
||||
LATEST_WASI_VERSION
|
||||
}
|
||||
}
|
||||
|
||||
pub fn build(should_gen_all: bool) {
|
||||
let rust_test_modpath = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/wasitests/mod.rs");
|
||||
|
||||
let mut modules: Vec<String> = Vec::new();
|
||||
let wasi_versions = run_prelude(should_gen_all);
|
||||
|
||||
let temp_dir = tempfile::TempDir::new().unwrap();
|
||||
let ignores = read_ignore_list();
|
||||
for entry in glob("wasitests/*.rs").unwrap() {
|
||||
match entry {
|
||||
Ok(path) => {
|
||||
let test = path.to_str().unwrap();
|
||||
if let Some(module_name) = compile(test, &ignores) {
|
||||
modules.push(module_name);
|
||||
}
|
||||
modules.extend(compile(temp_dir.path(), test, &ignores, wasi_versions));
|
||||
}
|
||||
Err(e) => println!("{:?}", e),
|
||||
}
|
||||
}
|
||||
println!("All modules generated. Generating test harness.");
|
||||
modules.sort();
|
||||
let mut modules: Vec<String> = modules.iter().map(|m| format!("mod {};", m)).collect();
|
||||
assert!(modules.len() > 0, "Expected > 0 modules found");
|
||||
@ -213,10 +312,24 @@ pub fn build() {
|
||||
modules.push("".to_string());
|
||||
|
||||
let modfile: String = modules.join("\n");
|
||||
let source = fs::read(&rust_test_modpath).unwrap();
|
||||
// We only modify the mod file if has changed
|
||||
if source != modfile.as_bytes() {
|
||||
fs::write(&rust_test_modpath, modfile.as_bytes()).unwrap();
|
||||
let should_regen: bool = {
|
||||
if let Ok(mut f) = fs::File::open(&rust_test_modpath) {
|
||||
let mut s = String::new();
|
||||
f.read_to_string(&mut s).unwrap();
|
||||
s != modfile
|
||||
} else {
|
||||
false
|
||||
}
|
||||
};
|
||||
if should_regen {
|
||||
println!("Writing to `{}`", &rust_test_modpath);
|
||||
let mut test_harness_file = fs::OpenOptions::new()
|
||||
.write(true)
|
||||
.create(true)
|
||||
.truncate(true)
|
||||
.open(&rust_test_modpath)
|
||||
.unwrap();
|
||||
test_harness_file.write_all(modfile.as_bytes()).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
@ -292,17 +405,3 @@ fn extract_args_from_source_file(source_code: &str) -> Option<Args> {
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
fn print_info_on_error(output: &std::process::Output, context: &str) {
|
||||
if !output.status.success() {
|
||||
println!("{}", context);
|
||||
println!(
|
||||
"stdout:\n{}",
|
||||
std::str::from_utf8(&output.stdout[..]).unwrap()
|
||||
);
|
||||
eprintln!(
|
||||
"stderr:\n{}",
|
||||
std::str::from_utf8(&output.stderr[..]).unwrap()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ fn serializing_works() {
|
||||
b"PATH=/bin".into_iter().cloned().collect(),
|
||||
b"GOROOT=$HOME/.cargo/bin".into_iter().cloned().collect(),
|
||||
];
|
||||
let wasm_binary = include_bytes!("../wasitests/fd_read.wasm");
|
||||
let wasm_binary = include_bytes!("../wasitests/unstable/fd_read.wasm");
|
||||
let module = compile(&wasm_binary[..])
|
||||
.map_err(|e| format!("Can't compile module: {:?}", e))
|
||||
.unwrap();
|
||||
|
@ -5,26 +5,49 @@
|
||||
// The _common module is not autogenerated. It provides common macros for the wasitests
|
||||
#[macro_use]
|
||||
mod _common;
|
||||
mod close_preopen_fd;
|
||||
mod create_dir;
|
||||
mod envvar;
|
||||
mod fd_allocate;
|
||||
mod fd_append;
|
||||
mod fd_close;
|
||||
mod fd_pread;
|
||||
mod fd_read;
|
||||
mod fd_sync;
|
||||
mod file_metadata;
|
||||
mod fs_sandbox_test;
|
||||
mod fseek;
|
||||
mod hello;
|
||||
mod isatty;
|
||||
mod mapdir;
|
||||
mod path_link;
|
||||
mod path_rename;
|
||||
mod path_symlink;
|
||||
mod poll_oneoff;
|
||||
mod quine;
|
||||
mod readlink;
|
||||
mod wasi_sees_virtual_root;
|
||||
mod writing;
|
||||
mod snapshot1_close_preopen_fd;
|
||||
mod snapshot1_create_dir;
|
||||
mod snapshot1_envvar;
|
||||
mod snapshot1_fd_allocate;
|
||||
mod snapshot1_fd_append;
|
||||
mod snapshot1_fd_close;
|
||||
mod snapshot1_fd_pread;
|
||||
mod snapshot1_fd_read;
|
||||
mod snapshot1_fd_sync;
|
||||
mod snapshot1_file_metadata;
|
||||
mod snapshot1_fs_sandbox_test;
|
||||
mod snapshot1_fseek;
|
||||
mod snapshot1_hello;
|
||||
mod snapshot1_isatty;
|
||||
mod snapshot1_mapdir;
|
||||
mod snapshot1_path_link;
|
||||
mod snapshot1_path_rename;
|
||||
mod snapshot1_path_symlink;
|
||||
mod snapshot1_poll_oneoff;
|
||||
mod snapshot1_quine;
|
||||
mod snapshot1_readlink;
|
||||
mod snapshot1_wasi_sees_virtual_root;
|
||||
mod snapshot1_writing;
|
||||
mod unstable_close_preopen_fd;
|
||||
mod unstable_create_dir;
|
||||
mod unstable_envvar;
|
||||
mod unstable_fd_allocate;
|
||||
mod unstable_fd_append;
|
||||
mod unstable_fd_close;
|
||||
mod unstable_fd_pread;
|
||||
mod unstable_fd_read;
|
||||
mod unstable_fd_sync;
|
||||
mod unstable_file_metadata;
|
||||
mod unstable_fs_sandbox_test;
|
||||
mod unstable_fseek;
|
||||
mod unstable_hello;
|
||||
mod unstable_isatty;
|
||||
mod unstable_mapdir;
|
||||
mod unstable_path_link;
|
||||
mod unstable_path_rename;
|
||||
mod unstable_path_symlink;
|
||||
mod unstable_poll_oneoff;
|
||||
mod unstable_quine;
|
||||
mod unstable_readlink;
|
||||
mod unstable_wasi_sees_virtual_root;
|
||||
mod unstable_writing;
|
||||
|
19
lib/wasi-tests/tests/wasitests/snapshot1_close_preopen_fd.rs
Normal file
19
lib/wasi-tests/tests/wasitests/snapshot1_close_preopen_fd.rs
Normal file
@ -0,0 +1,19 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
15
lib/wasi-tests/tests/wasitests/snapshot1_create_dir.rs
Normal file
15
lib/wasi-tests/tests/wasitests/snapshot1_create_dir.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// !!! 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_create_dir() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/snapshot1/create_dir.wasm",
|
||||
"snapshot1_create_dir",
|
||||
vec![std::path::PathBuf::from("."),],
|
||||
vec![],
|
||||
vec![],
|
||||
"../../wasitests/create_dir.out"
|
||||
);
|
||||
}
|
15
lib/wasi-tests/tests/wasitests/snapshot1_envvar.rs
Normal file
15
lib/wasi-tests/tests/wasitests/snapshot1_envvar.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// !!! 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_envvar() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/snapshot1/envvar.wasm",
|
||||
"snapshot1_envvar",
|
||||
vec![],
|
||||
vec![],
|
||||
vec!["DOG=1".to_string(), "CAT=2".to_string(),],
|
||||
"../../wasitests/envvar.out"
|
||||
);
|
||||
}
|
19
lib/wasi-tests/tests/wasitests/snapshot1_fd_allocate.rs
Normal file
19
lib/wasi-tests/tests/wasitests/snapshot1_fd_allocate.rs
Normal file
@ -0,0 +1,19 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
18
lib/wasi-tests/tests/wasitests/snapshot1_fd_append.rs
Normal file
18
lib/wasi-tests/tests/wasitests/snapshot1_fd_append.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
19
lib/wasi-tests/tests/wasitests/snapshot1_fd_close.rs
Normal file
19
lib/wasi-tests/tests/wasitests/snapshot1_fd_close.rs
Normal file
@ -0,0 +1,19 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
19
lib/wasi-tests/tests/wasitests/snapshot1_fd_pread.rs
Normal file
19
lib/wasi-tests/tests/wasitests/snapshot1_fd_pread.rs
Normal file
@ -0,0 +1,19 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
19
lib/wasi-tests/tests/wasitests/snapshot1_fd_read.rs
Normal file
19
lib/wasi-tests/tests/wasitests/snapshot1_fd_read.rs
Normal file
@ -0,0 +1,19 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
18
lib/wasi-tests/tests/wasitests/snapshot1_fd_sync.rs
Normal file
18
lib/wasi-tests/tests/wasitests/snapshot1_fd_sync.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
15
lib/wasi-tests/tests/wasitests/snapshot1_file_metadata.rs
Normal file
15
lib/wasi-tests/tests/wasitests/snapshot1_file_metadata.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// !!! 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_file_metadata() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/snapshot1/file_metadata.wasm",
|
||||
"snapshot1_file_metadata",
|
||||
vec![std::path::PathBuf::from("."),],
|
||||
vec![],
|
||||
vec![],
|
||||
"../../wasitests/file_metadata.out"
|
||||
);
|
||||
}
|
15
lib/wasi-tests/tests/wasitests/snapshot1_fs_sandbox_test.rs
Normal file
15
lib/wasi-tests/tests/wasitests/snapshot1_fs_sandbox_test.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// !!! 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_fs_sandbox_test() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/snapshot1/fs_sandbox_test.wasm",
|
||||
"snapshot1_fs_sandbox_test",
|
||||
vec![],
|
||||
vec![],
|
||||
vec![],
|
||||
"../../wasitests/fs_sandbox_test.out"
|
||||
);
|
||||
}
|
18
lib/wasi-tests/tests/wasitests/snapshot1_fseek.rs
Normal file
18
lib/wasi-tests/tests/wasitests/snapshot1_fseek.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
15
lib/wasi-tests/tests/wasitests/snapshot1_hello.rs
Normal file
15
lib/wasi-tests/tests/wasitests/snapshot1_hello.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// !!! 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_hello() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/snapshot1/hello.wasm",
|
||||
"snapshot1_hello",
|
||||
vec![],
|
||||
vec![],
|
||||
vec![],
|
||||
"../../wasitests/hello.out"
|
||||
);
|
||||
}
|
15
lib/wasi-tests/tests/wasitests/snapshot1_isatty.rs
Normal file
15
lib/wasi-tests/tests/wasitests/snapshot1_isatty.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// !!! 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_isatty() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/snapshot1/isatty.wasm",
|
||||
"snapshot1_isatty",
|
||||
vec![],
|
||||
vec![],
|
||||
vec![],
|
||||
"../../wasitests/isatty.out"
|
||||
);
|
||||
}
|
18
lib/wasi-tests/tests/wasitests/snapshot1_mapdir.rs
Normal file
18
lib/wasi-tests/tests/wasitests/snapshot1_mapdir.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
24
lib/wasi-tests/tests/wasitests/snapshot1_path_link.rs
Normal file
24
lib/wasi-tests/tests/wasitests/snapshot1_path_link.rs
Normal file
@ -0,0 +1,24 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
18
lib/wasi-tests/tests/wasitests/snapshot1_path_rename.rs
Normal file
18
lib/wasi-tests/tests/wasitests/snapshot1_path_rename.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
24
lib/wasi-tests/tests/wasitests/snapshot1_path_symlink.rs
Normal file
24
lib/wasi-tests/tests/wasitests/snapshot1_path_symlink.rs
Normal file
@ -0,0 +1,24 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
25
lib/wasi-tests/tests/wasitests/snapshot1_poll_oneoff.rs
Normal file
25
lib/wasi-tests/tests/wasitests/snapshot1_poll_oneoff.rs
Normal file
@ -0,0 +1,25 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
15
lib/wasi-tests/tests/wasitests/snapshot1_quine.rs
Normal file
15
lib/wasi-tests/tests/wasitests/snapshot1_quine.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// !!! 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_quine() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/snapshot1/quine.wasm",
|
||||
"snapshot1_quine",
|
||||
vec![std::path::PathBuf::from("."),],
|
||||
vec![],
|
||||
vec![],
|
||||
"../../wasitests/quine.out"
|
||||
);
|
||||
}
|
18
lib/wasi-tests/tests/wasitests/snapshot1_readlink.rs
Normal file
18
lib/wasi-tests/tests/wasitests/snapshot1_readlink.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
28
lib/wasi-tests/tests/wasitests/snapshot1_writing.rs
Normal file
28
lib/wasi-tests/tests/wasitests/snapshot1_writing.rs
Normal file
@ -0,0 +1,28 @@
|
||||
// !!! 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"
|
||||
);
|
||||
}
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_close_preopen_fd() {
|
||||
fn test_unstable_close_preopen_fd() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/close_preopen_fd.wasm",
|
||||
"close_preopen_fd",
|
||||
"../../wasitests/unstable/close_preopen_fd.wasm",
|
||||
"unstable_close_preopen_fd",
|
||||
vec![],
|
||||
vec![(
|
||||
"hamlet".to_string(),
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_create_dir() {
|
||||
fn test_unstable_create_dir() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/create_dir.wasm",
|
||||
"create_dir",
|
||||
"../../wasitests/unstable/create_dir.wasm",
|
||||
"unstable_create_dir",
|
||||
vec![std::path::PathBuf::from("."),],
|
||||
vec![],
|
||||
vec![],
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_envvar() {
|
||||
fn test_unstable_envvar() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/envvar.wasm",
|
||||
"envvar",
|
||||
"../../wasitests/unstable/envvar.wasm",
|
||||
"unstable_envvar",
|
||||
vec![],
|
||||
vec![],
|
||||
vec!["DOG=1".to_string(), "CAT=2".to_string(),],
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_fd_allocate() {
|
||||
fn test_unstable_fd_allocate() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/fd_allocate.wasm",
|
||||
"fd_allocate",
|
||||
"../../wasitests/unstable/fd_allocate.wasm",
|
||||
"unstable_fd_allocate",
|
||||
vec![],
|
||||
vec![(
|
||||
".".to_string(),
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_fd_append() {
|
||||
fn test_unstable_fd_append() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/fd_append.wasm",
|
||||
"fd_append",
|
||||
"../../wasitests/unstable/fd_append.wasm",
|
||||
"unstable_fd_append",
|
||||
vec![],
|
||||
vec![(
|
||||
".".to_string(),
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_fd_close() {
|
||||
fn test_unstable_fd_close() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/fd_close.wasm",
|
||||
"fd_close",
|
||||
"../../wasitests/unstable/fd_close.wasm",
|
||||
"unstable_fd_close",
|
||||
vec![],
|
||||
vec![(
|
||||
".".to_string(),
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_fd_pread() {
|
||||
fn test_unstable_fd_pread() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/fd_pread.wasm",
|
||||
"fd_pread",
|
||||
"../../wasitests/unstable/fd_pread.wasm",
|
||||
"unstable_fd_pread",
|
||||
vec![],
|
||||
vec![(
|
||||
".".to_string(),
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_fd_read() {
|
||||
fn test_unstable_fd_read() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/fd_read.wasm",
|
||||
"fd_read",
|
||||
"../../wasitests/unstable/fd_read.wasm",
|
||||
"unstable_fd_read",
|
||||
vec![],
|
||||
vec![(
|
||||
".".to_string(),
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_fd_sync() {
|
||||
fn test_unstable_fd_sync() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/fd_sync.wasm",
|
||||
"fd_sync",
|
||||
"../../wasitests/unstable/fd_sync.wasm",
|
||||
"unstable_fd_sync",
|
||||
vec![],
|
||||
vec![(
|
||||
".".to_string(),
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_file_metadata() {
|
||||
fn test_unstable_file_metadata() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/file_metadata.wasm",
|
||||
"file_metadata",
|
||||
"../../wasitests/unstable/file_metadata.wasm",
|
||||
"unstable_file_metadata",
|
||||
vec![std::path::PathBuf::from("."),],
|
||||
vec![],
|
||||
vec![],
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_fs_sandbox_test() {
|
||||
fn test_unstable_fs_sandbox_test() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/fs_sandbox_test.wasm",
|
||||
"fs_sandbox_test",
|
||||
"../../wasitests/unstable/fs_sandbox_test.wasm",
|
||||
"unstable_fs_sandbox_test",
|
||||
vec![],
|
||||
vec![],
|
||||
vec![],
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_fseek() {
|
||||
fn test_unstable_fseek() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/fseek.wasm",
|
||||
"fseek",
|
||||
"../../wasitests/unstable/fseek.wasm",
|
||||
"unstable_fseek",
|
||||
vec![],
|
||||
vec![(
|
||||
".".to_string(),
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_hello() {
|
||||
fn test_unstable_hello() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/hello.wasm",
|
||||
"hello",
|
||||
"../../wasitests/unstable/hello.wasm",
|
||||
"unstable_hello",
|
||||
vec![],
|
||||
vec![],
|
||||
vec![],
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_isatty() {
|
||||
fn test_unstable_isatty() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/isatty.wasm",
|
||||
"isatty",
|
||||
"../../wasitests/unstable/isatty.wasm",
|
||||
"unstable_isatty",
|
||||
vec![],
|
||||
vec![],
|
||||
vec![],
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_mapdir() {
|
||||
fn test_unstable_mapdir() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/mapdir.wasm",
|
||||
"mapdir",
|
||||
"../../wasitests/unstable/mapdir.wasm",
|
||||
"unstable_mapdir",
|
||||
vec![],
|
||||
vec![(
|
||||
".".to_string(),
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_path_link() {
|
||||
fn test_unstable_path_link() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/path_link.wasm",
|
||||
"path_link",
|
||||
"../../wasitests/unstable/path_link.wasm",
|
||||
"unstable_path_link",
|
||||
vec![],
|
||||
vec![
|
||||
(
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_path_rename() {
|
||||
fn test_unstable_path_rename() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/path_rename.wasm",
|
||||
"path_rename",
|
||||
"../../wasitests/unstable/path_rename.wasm",
|
||||
"unstable_path_rename",
|
||||
vec![],
|
||||
vec![(
|
||||
"temp".to_string(),
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_path_symlink() {
|
||||
fn test_unstable_path_symlink() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/path_symlink.wasm",
|
||||
"path_symlink",
|
||||
"../../wasitests/unstable/path_symlink.wasm",
|
||||
"unstable_path_symlink",
|
||||
vec![],
|
||||
vec![
|
||||
(
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_poll_oneoff() {
|
||||
fn test_unstable_poll_oneoff() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/poll_oneoff.wasm",
|
||||
"poll_oneoff",
|
||||
"../../wasitests/unstable/poll_oneoff.wasm",
|
||||
"unstable_poll_oneoff",
|
||||
vec![],
|
||||
vec![
|
||||
(
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_quine() {
|
||||
fn test_unstable_quine() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/quine.wasm",
|
||||
"quine",
|
||||
"../../wasitests/unstable/quine.wasm",
|
||||
"unstable_quine",
|
||||
vec![std::path::PathBuf::from("."),],
|
||||
vec![],
|
||||
vec![],
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_readlink() {
|
||||
fn test_unstable_readlink() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/readlink.wasm",
|
||||
"readlink",
|
||||
"../../wasitests/unstable/readlink.wasm",
|
||||
"unstable_readlink",
|
||||
vec![],
|
||||
vec![(
|
||||
".".to_string(),
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_wasi_sees_virtual_root() {
|
||||
fn test_unstable_wasi_sees_virtual_root() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/wasi_sees_virtual_root.wasm",
|
||||
"wasi_sees_virtual_root",
|
||||
"../../wasitests/unstable/wasi_sees_virtual_root.wasm",
|
||||
"unstable_wasi_sees_virtual_root",
|
||||
vec![],
|
||||
vec![
|
||||
(
|
@ -3,10 +3,10 @@
|
||||
// Files autogenerated with cargo build (build/wasitests.rs).
|
||||
|
||||
#[test]
|
||||
fn test_writing() {
|
||||
fn test_unstable_writing() {
|
||||
assert_wasi_output!(
|
||||
"../../wasitests/writing.wasm",
|
||||
"writing",
|
||||
"../../wasitests/unstable/writing.wasm",
|
||||
"unstable_writing",
|
||||
vec![],
|
||||
vec![
|
||||
(
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +1,6 @@
|
||||
|
||||
snapshot1_fd_read
|
||||
snapshot1_poll_oneoff
|
||||
snapshot1_fd_pread
|
||||
snapshot1_fd_close
|
||||
snapshot1_fd_allocate
|
||||
snapshot1_close_preopen_fd
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/close_preopen_fd.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/close_preopen_fd.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/create_dir.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/create_dir.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/envvar.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/envvar.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/fd_allocate.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/fd_allocate.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/fd_append.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/fd_append.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/fd_close.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/fd_close.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/fd_pread.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/fd_pread.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/fd_read.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/fd_read.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/fd_sync.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/fd_sync.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/file_metadata.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/file_metadata.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/fs_sandbox_test.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/fs_sandbox_test.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/fseek.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/fseek.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/hello.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/hello.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/isatty.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/isatty.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/mapdir.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/mapdir.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/path_link.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/path_link.wasm
Executable file
Binary file not shown.
BIN
lib/wasi-tests/wasitests/snapshot1/path_rename.wasm
Executable file
BIN
lib/wasi-tests/wasitests/snapshot1/path_rename.wasm
Executable file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user