From 4b706ae25c2ab52f0aabdb78baeaef4cdcf3578c Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Wed, 30 Oct 2024 09:50:57 +0100 Subject: [PATCH] test: show output even when a test binary didn't exit cleanly This was a problem on wasm, where node would exit with a non-zero exit code when there was a panic. --- main_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main_test.go b/main_test.go index 14b3d1809..723a52267 100644 --- a/main_test.go +++ b/main_test.go @@ -429,6 +429,9 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c for _, line := range strings.Split(strings.TrimRight(w.String(), "\n"), "\n") { t.Log(line) } + if stdout.Len() != 0 { + t.Logf("output:\n%s", stdout.String()) + } t.Fail() return }