diff options
author | Damian Gryski <[email protected]> | 2021-11-12 13:46:29 -0800 |
---|---|---|
committer | Ron Evans <[email protected]> | 2021-11-13 12:01:20 +0100 |
commit | 782c57cc1129b2efe29e4f3d7e75fd87439fe545 (patch) | |
tree | 2396863a7fdd3173e7332e5a229b9658aeaa1a45 | |
parent | c1d697f86886a29e46148e80a4cd796598d0d5fd (diff) | |
download | tinygo-782c57cc1129b2efe29e4f3d7e75fd87439fe545.tar.gz tinygo-782c57cc1129b2efe29e4f3d7e75fd87439fe545.zip |
pass testing arguments to wasmtime
-rw-r--r-- | main.go | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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 |