Skip to content

Commit

Permalink
updates from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark McCaskey committed Jul 19, 2019
1 parent 328ef4e commit a0672b3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
6 changes: 3 additions & 3 deletions lib/wasi-tests/build/wasitests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ pub fn compile(file: &str, ignores: &HashSet<String>) -> Option<String> {
out_str
};

let po_args = {
let dir_args = {
let mut out_str = String::new();
out_str.push_str("vec![");

Expand All @@ -134,7 +134,7 @@ fn test_{rs_module_name}() {{
assert_wasi_output!(
\"../../{module_path}\",
\"{rs_module_name}\",
{po_args},
{dir_args},
{mapdir_args},
{envvar_args},
\"../../{test_output_path}\"
Expand All @@ -145,7 +145,7 @@ fn test_{rs_module_name}() {{
module_path = wasm_out_name,
rs_module_name = rs_module_name,
test_output_path = format!("{}.out", normalized_name),
po_args = po_args,
dir_args = dir_args,
mapdir_args = mapdir_args,
envvar_args = envvar_args
);
Expand Down
5 changes: 0 additions & 5 deletions lib/wasi-tests/wasitests/mapdir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
use std::fs;

fn main() {
#[cfg(not(target_os = "wasi"))]
let cur_dir = std::env::current_dir().unwrap();
#[cfg(not(target_os = "wasi"))]
std::env::set_current_dir("wasitests/test_fs/hamlet").unwrap();

Expand All @@ -19,7 +17,4 @@ fn main() {
for p in out {
println!("{}", p);
}
// return to the current directory
#[cfg(not(target_os = "wasi"))]
std::env::set_current_dir(cur_dir).unwrap();
}
6 changes: 0 additions & 6 deletions lib/wasi-tests/wasitests/readlink.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
use std::io::Read;

fn main() {
#[cfg(not(target_os = "wasi"))]
let cur_dir = std::env::current_dir().unwrap();
#[cfg(not(target_os = "wasi"))]
std::env::set_current_dir("wasitests/test_fs/hamlet").unwrap();

Expand All @@ -20,8 +18,4 @@ fn main() {
assert_eq!(some_contents.read(&mut buffer).unwrap(), 128);
let str_val = std::str::from_utf8(&buffer[..]).unwrap();
println!("{}", str_val);

// return to the current directory
#[cfg(not(target_os = "wasi"))]
std::env::set_current_dir(cur_dir).unwrap();
}
Binary file modified lib/wasi-tests/wasitests/readlink.wasm
Binary file not shown.
2 changes: 2 additions & 0 deletions lib/wasi/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ use std::{
};
use wasmer_runtime_core::debug;

/// A completely aribtrary "big enough" number used as the upper limit for
/// the number of symlinks that can be traversed when resolving a path
pub const MAX_SYMLINKS: u32 = 128;

#[derive(Debug)]
Expand Down

0 comments on commit a0672b3

Please sign in to comment.