From 782c57cc1129b2efe29e4f3d7e75fd87439fe545 Mon Sep 17 00:00:00 2001 From: Damian Gryski Date: Fri, 12 Nov 2021 13:46:29 -0800 Subject: pass testing arguments to wasmtime --- main.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 9e53d2f96..af3ed554f 100644 --- a/main.go +++ b/main.go @@ -244,8 +244,18 @@ func runPackageTest(config *compileopts.Config, result builder.BuildResult, test cmd.Dir = result.MainDir } else { // Run in an emulator. - // TODO: pass the -test.v flag if needed. args := append(config.Target.Emulator[1:], result.Binary) + if config.Target.Emulator[0] == "wasmtime" { + // allow reading from current directory: --dir=. + // mark end of wasmtime arguments and start of program ones: -- + args = append(args, "--dir=.", "--") + if testVerbose { + args = append(args, "-test.v") + } + if testShort { + args = append(args, "-test.short") + } + } cmd = executeCommand(config.Options, config.Target.Emulator[0], args...) } cmd.Stdout = os.Stdout -- cgit v1.2.3