diff options
author | Ayke van Laethem <[email protected]> | 2023-01-14 17:16:42 +0100 |
---|---|---|
committer | Ron Evans <[email protected]> | 2023-01-15 08:49:18 +0100 |
commit | 80077ef2765ab0616ac014fe3989c345e2770abc (patch) | |
tree | 7a2a3f127f77f42fb6307afd7e9eff79cdce1df6 /main_test.go | |
parent | 911ce3a4bcaaed7140bd1922c3c5f5645d87f08d (diff) | |
download | tinygo-80077ef2765ab0616ac014fe3989c345e2770abc.tar.gz tinygo-80077ef2765ab0616ac014fe3989c345e2770abc.zip |
test: print package name when compilation failed
Before this patch, a compile error would prevent the 'ok' or 'FAIL' line
to be printed. That's unexpected. This patch changes the code in such a
way that it's obvious a test result line is printed in all cases.
To be able to also print the package name, I had to make sure the build
result is passed through everywhere even on all the failure paths. This
results in a bit of churn, but it's all relatively straightforward.
Found while working on Go 1.20.
Diffstat (limited to 'main_test.go')
-rw-r--r-- | main_test.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/main_test.go b/main_test.go index af2a7c7f7..72f3c4bbc 100644 --- a/main_test.go +++ b/main_test.go @@ -329,7 +329,7 @@ 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, func(cmd *exec.Cmd, result builder.BuildResult) error { + _, err = buildAndRun("./"+path, config, stdout, cmdArgs, environmentVars, time.Minute, func(cmd *exec.Cmd, result builder.BuildResult) error { return cmd.Run() }) if err != nil { |