This commit is contained in:
Mark McCaskey 2019-07-17 15:47:59 -07:00
parent e7e1b8c7d3
commit dc19bf32b9
6 changed files with 28 additions and 7 deletions

View File

@ -33,8 +33,7 @@ macro_rules! assert_wasi_output {
let module = wasmer_runtime_core::compile_with(&wasm_bytes[..], &get_compiler()) let module = wasmer_runtime_core::compile_with(&wasm_bytes[..], &get_compiler())
.expect("WASM can't be compiled"); .expect("WASM can't be compiled");
let import_object = let import_object = generate_import_object(vec![], vec![], $po_dir_args, $mapdir_args);
generate_import_object(vec![], vec![], $po_dir_args, $mapdir_args);
let instance = module let instance = module
.instantiate(&import_object) .instantiate(&import_object)

View File

@ -5,7 +5,7 @@ fn test_envvar() {
"envvar", "envvar",
vec![], vec![],
vec![], vec![],
vec!["DOG=1".to_string(),"CAT=2".to_string(),], vec!["DOG=1".to_string(), "CAT=2".to_string(),],
"../../wasitests/envvar.out" "../../wasitests/envvar.out"
); );
} }

View File

@ -4,7 +4,10 @@ fn test_fseek() {
"../../wasitests/fseek.wasm", "../../wasitests/fseek.wasm",
"fseek", "fseek",
vec![], vec![],
vec![(".".to_string(), ::std::path::PathBuf::from("wasitests/test_fs/hamlet")),], vec![(
".".to_string(),
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
),],
vec![], vec![],
"../../wasitests/fseek.out" "../../wasitests/fseek.out"
); );

View File

@ -4,7 +4,10 @@ fn test_mapdir() {
"../../wasitests/mapdir.wasm", "../../wasitests/mapdir.wasm",
"mapdir", "mapdir",
vec![], vec![],
vec![(".".to_string(), ::std::path::PathBuf::from("wasitests/test_fs/hamlet")),], vec![(
".".to_string(),
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
),],
vec![], vec![],
"../../wasitests/mapdir.out" "../../wasitests/mapdir.out"
); );

View File

@ -4,7 +4,10 @@ fn test_readlink() {
"../../wasitests/readlink.wasm", "../../wasitests/readlink.wasm",
"readlink", "readlink",
vec![], vec![],
vec![(".".to_string(), ::std::path::PathBuf::from("wasitests/test_fs/hamlet")),], vec![(
".".to_string(),
::std::path::PathBuf::from("wasitests/test_fs/hamlet")
),],
vec![], vec![],
"../../wasitests/readlink.out" "../../wasitests/readlink.out"
); );

View File

@ -4,7 +4,20 @@ fn test_wasi_sees_virtual_root() {
"../../wasitests/wasi_sees_virtual_root.wasm", "../../wasitests/wasi_sees_virtual_root.wasm",
"wasi_sees_virtual_root", "wasi_sees_virtual_root",
vec![], 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![
(
"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![], vec![],
"../../wasitests/wasi_sees_virtual_root.out" "../../wasitests/wasi_sees_virtual_root.out"
); );