aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/testing
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-04-06 14:04:45 -0700
committerIan Lance Taylor <iant@golang.org>2020-04-06 16:37:24 -0700
commit52fa80f853c0b0f623ea9e4c7198e324ce44ff30 (patch)
treee2695726e95b7bd125d52b7bdd315cb0028854fa /libgo/go/testing
parent749bd22ddc50b5112e5ed506ffef7249bf8e6fb3 (diff)
downloadgcc-52fa80f853c0b0f623ea9e4c7198e324ce44ff30.zip
gcc-52fa80f853c0b0f623ea9e4c7198e324ce44ff30.tar.gz
gcc-52fa80f853c0b0f623ea9e4c7198e324ce44ff30.tar.bz2
libgo: update to almost the 1.14.2 release
Update to edea4a79e8d7dea2456b688f492c8af33d381dc2 which is likely to be approximately the 1.14.2 release. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/227377
Diffstat (limited to 'libgo/go/testing')
-rw-r--r--libgo/go/testing/testing.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/libgo/go/testing/testing.go b/libgo/go/testing/testing.go
index 0891142..758af74 100644
--- a/libgo/go/testing/testing.go
+++ b/libgo/go/testing/testing.go
@@ -963,16 +963,15 @@ func tRunner(t *T, fn func(t *T)) {
t.Logf("cleanup panicked with %v", r)
}
// Flush the output log up to the root before dying.
- t.mu.Lock()
- root := &t.common
- for ; root.parent != nil; root = root.parent {
+ for root := &t.common; root.parent != nil; root = root.parent {
+ root.mu.Lock()
root.duration += time.Since(root.start)
- fmt.Fprintf(root.parent.w, "--- FAIL: %s (%s)\n", root.name, fmtDuration(root.duration))
+ d := root.duration
+ root.mu.Unlock()
+ root.flushToParent("--- FAIL: %s (%s)\n", root.name, fmtDuration(d))
if r := root.parent.runCleanup(recoverAndReturnPanic); r != nil {
fmt.Fprintf(root.parent.w, "cleanup panicked with %v", r)
}
- root.parent.mu.Lock()
- io.Copy(root.parent.w, bytes.NewReader(root.output))
}
panic(err)
}