aboutsummaryrefslogtreecommitdiffhomepage
path: root/main_test.go
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2022-04-19 23:07:31 +0200
committerRon Evans <[email protected]>2022-04-20 08:22:46 +0200
commit9160f3f16dfd39011054dac2423679a90777f172 (patch)
treed91155fa971ef891172fae20804b4658203439a0 /main_test.go
parent69d7ed5cda49a3744324e7486ccfc6f655cfafb4 (diff)
downloadtinygo-9160f3f16dfd39011054dac2423679a90777f172.tar.gz
tinygo-9160f3f16dfd39011054dac2423679a90777f172.zip
main: use shared code for both run and test subcommands
This means that we don't need duplicate code to pass parameters to wasmtime and that the following actually produces verbose output (it didn't before this commit): tinygo test -v -target=cortex-m-qemu math
Diffstat (limited to 'main_test.go')
-rw-r--r--main_test.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/main_test.go b/main_test.go
index 4b043932c..efb4b5143 100644
--- a/main_test.go
+++ b/main_test.go
@@ -332,7 +332,9 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c
// Build the test binary.
stdout := &bytes.Buffer{}
- err = buildAndRun("./"+path, config, stdout, cmdArgs, environmentVars, time.Minute)
+ err = buildAndRun("./"+path, config, stdout, cmdArgs, environmentVars, time.Minute, func(cmd *exec.Cmd, result builder.BuildResult) error {
+ return cmd.Run()
+ })
if err != nil {
printCompilerError(t.Log, err)
t.Fail()