aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDamian Gryski <[email protected]>2021-11-12 13:46:29 -0800
committerRon Evans <[email protected]>2021-11-13 12:01:20 +0100
commit782c57cc1129b2efe29e4f3d7e75fd87439fe545 (patch)
tree2396863a7fdd3173e7332e5a229b9658aeaa1a45
parentc1d697f86886a29e46148e80a4cd796598d0d5fd (diff)
downloadtinygo-782c57cc1129b2efe29e4f3d7e75fd87439fe545.tar.gz
tinygo-782c57cc1129b2efe29e4f3d7e75fd87439fe545.zip
pass testing arguments to wasmtime
-rw-r--r--main.go12
1 files changed, 11 insertions, 1 deletions
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