diff --git a/test/clocks/res_get-monotonic-success.wat b/test/clocks/res_get-monotonic-success.wat new file mode 100644 index 0000000..c1688b3 --- /dev/null +++ b/test/clocks/res_get-monotonic-success.wat @@ -0,0 +1,14 @@ +(module + (import "wasi_snapshot_preview1" "clock_res_get" (func $res_get (param i32 i32) (result i32))) + (memory 1) + (export "memory" (memory 0)) + (func $_start + i32.const 1 + i32.const 0 + call $res_get + if + unreachable + end + ) + (export "_start" (func $_start)) +) diff --git a/test/clocks/res_get-negative-invalid.wat b/test/clocks/res_get-negative-invalid.wat new file mode 100644 index 0000000..f031364 --- /dev/null +++ b/test/clocks/res_get-negative-invalid.wat @@ -0,0 +1,17 @@ +(module + (import "wasi_snapshot_preview1" "clock_res_get" (func $res_get (param i32 i32) (result i32))) + (memory $0 0) + (export "memory" (memory $0)) + (func $_start + i32.const -1 + i32.const 0 + call $res_get + i32.const 28 + i32.ne + if + unreachable + end + ) + (export "_start" (func $_start)) +) + diff --git a/test/clocks/res_get-realtime-success.wat b/test/clocks/res_get-realtime-success.wat new file mode 100644 index 0000000..7564ae8 --- /dev/null +++ b/test/clocks/res_get-realtime-success.wat @@ -0,0 +1,14 @@ +(module + (import "wasi_snapshot_preview1" "clock_res_get" (func $res_get (param i32 i32) (result i32))) + (memory 1) + (export "memory" (memory 0)) + (func $_start + i32.const 0 + i32.const 0 + call $res_get + if + unreachable + end + ) + (export "_start" (func $_start)) +) diff --git a/test/clocks/time_get-monotonic-success.wat b/test/clocks/time_get-monotonic-success.wat new file mode 100644 index 0000000..a9afb64 --- /dev/null +++ b/test/clocks/time_get-monotonic-success.wat @@ -0,0 +1,15 @@ +(module + (import "wasi_snapshot_preview1" "clock_time_get" (func $time_get (param i32 i64 i32) (result i32))) + (memory 1) + (export "memory" (memory 0)) + (func $_start + i32.const 1 + i64.const 0 + i32.const 0 + call $time_get + if + unreachable + end + ) + (export "_start" (func $_start)) +) diff --git a/test/clocks/time_get-realtime-success.wat b/test/clocks/time_get-realtime-success.wat new file mode 100644 index 0000000..97872a0 --- /dev/null +++ b/test/clocks/time_get-realtime-success.wat @@ -0,0 +1,15 @@ +(module + (import "wasi_snapshot_preview1" "clock_time_get" (func $time_get (param i32 i64 i32) (result i32))) + (memory 1) + (export "memory" (memory 0)) + (func $_start + i32.const 0 + i64.const 0 + i32.const 0 + call $time_get + if + unreachable + end + ) + (export "_start" (func $_start)) +) diff --git a/test/run_all.sh b/test/run_all.sh new file mode 100644 index 0000000..6fd40c4 --- /dev/null +++ b/test/run_all.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env + +runtime=$1 +shift + +for input in $@; do + echo "$input" + $runtime $input && echo "PASS" || echo "FAIL" +done