diff options
author | Ian Lance Taylor <iant@golang.org> | 2020-09-22 20:30:08 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2020-09-23 17:32:49 -0700 |
commit | 10a83805e047a583348e8bef18b966ecb8eee5d4 (patch) | |
tree | 0e35588beed26134397f6e25aa58dfd3600ed8db /libgo/go/testing | |
parent | 82b77dee751c916bcef55e527bffdd82b68fc897 (diff) | |
download | gcc-10a83805e047a583348e8bef18b966ecb8eee5d4.zip gcc-10a83805e047a583348e8bef18b966ecb8eee5d4.tar.gz gcc-10a83805e047a583348e8bef18b966ecb8eee5d4.tar.bz2 |
libgo: update to Go1.15.2 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/256618
Diffstat (limited to 'libgo/go/testing')
-rw-r--r-- | libgo/go/testing/testing.go | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/libgo/go/testing/testing.go b/libgo/go/testing/testing.go index dee77f7..fe6929d 100644 --- a/libgo/go/testing/testing.go +++ b/libgo/go/testing/testing.go @@ -357,10 +357,19 @@ func (p *testPrinter) Fprint(w io.Writer, testName, out string) { defer p.lastNameMu.Unlock() if !p.chatty || - strings.HasPrefix(out, "--- PASS") || - strings.HasPrefix(out, "--- FAIL") || - strings.HasPrefix(out, "=== CONT") || - strings.HasPrefix(out, "=== RUN") { + strings.HasPrefix(out, "--- PASS: ") || + strings.HasPrefix(out, "--- FAIL: ") || + strings.HasPrefix(out, "--- SKIP: ") || + strings.HasPrefix(out, "=== RUN ") || + strings.HasPrefix(out, "=== CONT ") || + strings.HasPrefix(out, "=== PAUSE ") { + // If we're buffering test output (!p.chatty), we don't really care which + // test is emitting which line so long as they are serialized. + // + // If the message already implies an association with a specific new test, + // we don't need to check what the old test name was or log an extra CONT + // line for it. (We're updating it anyway, and the current message already + // includes the test name.) p.lastName = testName fmt.Fprint(w, out) return @@ -887,11 +896,15 @@ func (c *common) Cleanup(f func()) { c.cleanup = func() { if oldCleanup != nil { defer func() { + c.mu.Lock() c.cleanupPc = oldCleanupPc + c.mu.Unlock() oldCleanup() }() } + c.mu.Lock() c.cleanupName = callerName(0) + c.mu.Unlock() f() } var pc [maxStackLen]uintptr @@ -1012,7 +1025,13 @@ func (t *T) Parallel() { for ; root.parent != nil; root = root.parent { } root.mu.Lock() - fmt.Fprintf(root.w, "=== PAUSE %s\n", t.name) + // Unfortunately, even though PAUSE indicates that the named test is *no + // longer* running, cmd/test2json interprets it as changing the active test + // for the purpose of log parsing. We could fix cmd/test2json, but that + // won't fix existing deployments of third-party tools that already shell + // out to older builds of cmd/test2json — so merely fixing cmd/test2json + // isn't enough for now. + printer.Fprint(root.w, t.name, fmt.Sprintf("=== PAUSE %s\n", t.name)) root.mu.Unlock() } |