@@ -357,10 +357,19 @@ func (p *testPrinter) Fprint(w io.Writer, testName, out string) {
357
357
defer p .lastNameMu .Unlock ()
358
358
359
359
if ! p .chatty ||
360
- strings .HasPrefix (out , "--- PASS" ) ||
361
- strings .HasPrefix (out , "--- FAIL" ) ||
362
- strings .HasPrefix (out , "=== CONT" ) ||
363
- strings .HasPrefix (out , "=== RUN" ) {
360
+ strings .HasPrefix (out , "--- PASS: " ) ||
361
+ strings .HasPrefix (out , "--- FAIL: " ) ||
362
+ strings .HasPrefix (out , "--- SKIP: " ) ||
363
+ strings .HasPrefix (out , "=== RUN " ) ||
364
+ strings .HasPrefix (out , "=== CONT " ) ||
365
+ strings .HasPrefix (out , "=== PAUSE " ) {
366
+ // If we're buffering test output (!p.chatty), we don't really care which
367
+ // test is emitting which line so long as they are serialized.
368
+ //
369
+ // If the message already implies an association with a specific new test,
370
+ // we don't need to check what the old test name was or log an extra CONT
371
+ // line for it. (We're updating it anyway, and the current message already
372
+ // includes the test name.)
364
373
p .lastName = testName
365
374
fmt .Fprint (w , out )
366
375
return
@@ -980,7 +989,13 @@ func (t *T) Parallel() {
980
989
for ; root .parent != nil ; root = root .parent {
981
990
}
982
991
root .mu .Lock ()
983
- fmt .Fprintf (root .w , "=== PAUSE %s\n " , t .name )
992
+ // Unfortunately, even though PAUSE indicates that the named test is *no
993
+ // longer* running, cmd/test2json interprets it as changing the active test
994
+ // for the purpose of log parsing. We could fix cmd/test2json, but that
995
+ // won't fix existing deployments of third-party tools that already shell
996
+ // out to older builds of cmd/test2json — so merely fixing cmd/test2json
997
+ // isn't enough for now.
998
+ printer .Fprint (root .w , t .name , fmt .Sprintf ("=== PAUSE %s\n " , t .name ))
984
999
root .mu .Unlock ()
985
1000
}
986
1001
0 commit comments