aboutsummaryrefslogtreecommitdiffhomepage
path: root/testdata/wasmexit.go
diff options
context:
space:
mode:
Diffstat (limited to 'testdata/wasmexit.go')
-rw-r--r--testdata/wasmexit.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/testdata/wasmexit.go b/testdata/wasmexit.go
new file mode 100644
index 000000000..cbf587845
--- /dev/null
+++ b/testdata/wasmexit.go
@@ -0,0 +1,27 @@
+package main
+
+import (
+ "os"
+ "time"
+)
+
+func main() {
+ println("wasmexit test:", os.Args[1])
+ switch os.Args[1] {
+ case "normal":
+ return
+ case "exit-0":
+ os.Exit(0)
+ case "exit-0-sleep":
+ time.Sleep(time.Millisecond)
+ println("slept")
+ os.Exit(0)
+ case "exit-1":
+ os.Exit(1)
+ case "exit-1-sleep":
+ time.Sleep(time.Millisecond)
+ println("slept")
+ os.Exit(1)
+ }
+ println("unknown wasmexit test")
+}