@@ -352,10 +352,19 @@ func (p *testPrinter) Fprint(w io.Writer, testName, out string) {
352
352
defer p .lastNameMu .Unlock ()
353
353
354
354
if ! p .chatty ||
355
- strings .HasPrefix (out , "--- PASS" ) ||
356
- strings .HasPrefix (out , "--- FAIL" ) ||
357
- strings .HasPrefix (out , "=== CONT" ) ||
358
- strings .HasPrefix (out , "=== RUN" ) {
355
+ strings .HasPrefix (out , "--- PASS: " ) ||
356
+ strings .HasPrefix (out , "--- FAIL: " ) ||
357
+ strings .HasPrefix (out , "--- SKIP: " ) ||
358
+ strings .HasPrefix (out , "=== RUN " ) ||
359
+ strings .HasPrefix (out , "=== CONT " ) ||
360
+ strings .HasPrefix (out , "=== PAUSE " ) {
361
+ // If we're buffering test output (!p.chatty), we don't really care which
362
+ // test is emitting which line so long as they are serialized.
363
+ //
364
+ // If the message already implies an association with a specific new test,
365
+ // we don't need to check what the old test name was or log an extra CONT
366
+ // line for it. (We're updating it anyway, and the current message already
367
+ // includes the test name.)
359
368
p .lastName = testName
360
369
fmt .Fprint (w , out )
361
370
return
@@ -907,7 +916,13 @@ func (t *T) Parallel() {
907
916
for ; root .parent != nil ; root = root .parent {
908
917
}
909
918
root .mu .Lock ()
910
- fmt .Fprintf (root .w , "=== PAUSE %s\n " , t .name )
919
+ // Unfortunately, even though PAUSE indicates that the named test is *no
920
+ // longer* running, cmd/test2json interprets it as changing the active test
921
+ // for the purpose of log parsing. We could fix cmd/test2json, but that
922
+ // won't fix existing deployments of third-party tools that already shell
923
+ // out to older builds of cmd/test2json — so merely fixing cmd/test2json
924
+ // isn't enough for now.
925
+ printer .Fprint (root .w , t .name , fmt .Sprintf ("=== PAUSE %s\n " , t .name ))
911
926
root .mu .Unlock ()
912
927
}
913
928
0 commit comments