File: doc.go

package info (click to toggle)
gotestsum 1.8.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,060 kB
  • sloc: sh: 89; makefile: 16
file content (22 lines) | stat: -rw-r--r-- 732 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
Package testjson scans test2json output and builds up a summary of the events.
Events are passed to a formatter for output.

# Example

This example reads the test2json output from os.Stdin. It sends every
event to the handler, builds an Execution from the output, then it
prints the number of tests run.

	exec, err := testjson.ScanTestOutput(testjson.ScanConfig{
	    // Stdout is a reader that provides the test2json output stream.
	    Stdout: os.Stdin,
	    // Handler receives TestEvents and error lines.
	    Handler: eventHandler,
	})
	if err != nil {
	    return fmt.Errorf("failed to scan testjson: %w", err)
	}
	fmt.Println("Ran %d tests", exec.Total())
*/
package testjson // import "gotest.tools/gotestsum/testjson"