mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-13 07:23:39 +00:00
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.
This commit is contained in:
committed by
Ron Evans
parent
911ce3a4bc
commit
80077ef276
+1
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user