summaryrefslogtreecommitdiff
path: root/libgo/go/cmd/test2json/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/cmd/test2json/main.go')
-rw-r--r--libgo/go/cmd/test2json/main.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/libgo/go/cmd/test2json/main.go b/libgo/go/cmd/test2json/main.go
index 7bdc867bbe5..0385d8f246c 100644
--- a/libgo/go/cmd/test2json/main.go
+++ b/libgo/go/cmd/test2json/main.go
@@ -45,15 +45,17 @@
// pause - the test has been paused
// cont - the test has continued running
// pass - the test passed
-// fail - the test failed
+// bench - the benchmark printed log output but did not fail
+// fail - the test or benchmark failed
// output - the test printed output
+// skip - the test was skipped or the package contained no tests
//
// The Package field, if present, specifies the package being tested.
// When the go command runs parallel tests in -json mode, events from
// different tests are interlaced; the Package field allows readers to
// separate them.
//
-// The Test field, if present, specifies the test or example, or benchmark
+// The Test field, if present, specifies the test, example, or benchmark
// function that caused the event. Events for the overall package test
// do not set Test.
//
@@ -67,6 +69,14 @@
// the concatenation of the Output fields of all output events is the exact
// output of the test execution.
//
+// When a benchmark runs, it typically produces a single line of output
+// giving timing results. That line is reported in an event with Action == "output"
+// and no Test field. If a benchmark logs output or reports a failure
+// (for example, by using b.Log or b.Error), that extra output is reported
+// as a sequence of events with Test set to the benchmark name, terminated
+// by a final event with Action == "bench" or "fail".
+// Benchmarks have no events with Action == "run", "pause", or "cont".
+//
package main
import (