wire env variables through test runner to TESTCONFIG

This commit is contained in:
Pat Hickey
2021-01-28 11:34:18 -08:00
parent bbbe168ca1
commit e758318fee
3 changed files with 19 additions and 7 deletions

View File

@@ -28,6 +28,18 @@ pub fn instantiate(data: &[u8], bin_name: &str, workspace: Option<&Path>) -> any
builder = builder.preopened_dir(preopen_dir, ".")?;
}
#[cfg(windows)]
{
builder = builder
.env("ERRNO_MODE_WINDOWS", "1")?
.env("NO_DANGLING_SYMLINKS", "1")?
.env("NO_FD_ALLOCATE", "1")?;
}
#[cfg(unix)]
{
builder = builder.env("ERRNO_MODE_UNIX", "1")?;
}
let snapshot1 = wasi_c2_wasmtime::Wasi::new(&store, builder.build()?);
let mut linker = Linker::new(&store);