Skip to content

Commit

Permalink
Update Testing.md
Browse files Browse the repository at this point in the history
  • Loading branch information
caspervonb committed Jan 14, 2021
1 parent 1ccaf86 commit f944d5a
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ Additionally, any of the following optional auxilary files and directories may b
## Running tests

```bash
# Usage: $1 wasmtime <path_to_binary.wasm>
# Usage: $1 <runtime> <path_to_binary.wasm>
# $1 wasmtime proc_exit-success.wasm
# $1 wasmer proc_exit-failure.wasm
#!/usr/bin/env bash

runtime=$1
Expand All @@ -33,13 +35,25 @@ stdout_actual="$output/stdout"
stderr_actual="$output/stderr"
status_actual="$output/status"

if [ -e "$prefix.env" ]; then
env=$(sed -e 's/^/--env /' < "$input.env")
else
env=""
fi

if [ -e "$input.dir" ]; then
dir="--dir $input.dir"
else
dir=""
fi

status=0

"$runtime" $input \
< "$stdin" \
> "$stdout_actual" \
2> "$stderr_actual" \
|| status=$?
"$runtime" $dir $input \
< "$stdin" \
> "$stdout_actual" \
2> "$stderr_actual" \
|| status=$?

echo $status > "$status_actual"

Expand Down

0 comments on commit f944d5a

Please sign in to comment.