pass testing arguments to wasmtime

Этот коммит содержится в:
Damian Gryski 2021-11-12 13:46:29 -08:00 коммит произвёл Ron Evans
родитель c1d697f868
коммит 782c57cc11

12
main.go
Просмотреть файл

@ -244,8 +244,18 @@ func runPackageTest(config *compileopts.Config, result builder.BuildResult, test
cmd.Dir = result.MainDir cmd.Dir = result.MainDir
} else { } else {
// Run in an emulator. // Run in an emulator.
// TODO: pass the -test.v flag if needed.
args := append(config.Target.Emulator[1:], result.Binary) 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 = executeCommand(config.Options, config.Target.Emulator[0], args...)
} }
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout