<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/cmd/internal/test2json/testdata/panic.json, branch makepkg</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=makepkg</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=makepkg'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2022-11-09T17:33:07Z</updated>
<entry>
<title>cmd/go: print test2json start events</title>
<updated>2022-11-09T17:33:07Z</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2022-11-07T16:58:45Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=7a92c4fc637621368eb26a7e72bb027b29568e50'/>
<id>urn:sha1:7a92c4fc637621368eb26a7e72bb027b29568e50</id>
<content type='text'>
Add a new "Action":"start" test2json event to mark the
start of the test binary execution. This adds useful information
to the JSON traces, and it also lets programs watching test
execution see the order in which the tests are being run,
because we arrange for the starts to happen sequentially.

Change-Id: I9fc865a486a55a7e9315f8686f59a2aa06455884
Reviewed-on: https://go-review.googlesource.com/c/go/+/448357
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
Auto-Submit: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: Bryan Mills &lt;bcmills@google.com&gt;
</content>
</entry>
<entry>
<title>cmd/go: make go test -json report failures for panicking/exiting tests</title>
<updated>2020-03-06T17:28:04Z</updated>
<author>
<name>Jay Conrod</name>
<email>jayconrod@google.com</email>
</author>
<published>2020-03-05T16:11:47Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=5ea58c63468bbc7e8705ee13d0bddbf3693785fe'/>
<id>urn:sha1:5ea58c63468bbc7e8705ee13d0bddbf3693785fe</id>
<content type='text'>
'go test -json' should report that a test failed if the test binary
did not exit normally with status 0. This covers panics, non-zero
exits, and abnormal terminations.

These tests don't print a final result when run with -test.v (which is
used by 'go test -json'). The final result should be "PASS" or "FAIL"
on a line by itself. 'go test' prints "FAIL" in this case, but
includes error information.

test2json was changed in CL 192104 to report that a test passed if it
does not report a final status. This caused 'go test -json' to report
that a test passed after a panic or non-zero exit.

With this change, test2json treats "FAIL" with error information the
same as "FAIL" on a line by itself. This is intended to be a minimal
fix for backporting, but it will likely be replaced by a complete
solution for #29062.

Fixes #37555
Updates #29062
Updates #31969

Change-Id: Icb67bcd36bed97e6a8d51f4d14bf71f73c83ac3d
Reviewed-on: https://go-review.googlesource.com/c/go/+/222243
Run-TryBot: Jay Conrod &lt;jayconrod@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
</content>
</entry>
<entry>
<title>testing: provide additional information when test funcs panic</title>
<updated>2019-10-30T20:46:44Z</updated>
<author>
<name>Damien Neil</name>
<email>dneil@google.com</email>
</author>
<published>2019-05-30T16:46:56Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=81a74b4e8d4a1740529bb951eaa9569d429e4c0f'/>
<id>urn:sha1:81a74b4e8d4a1740529bb951eaa9569d429e4c0f</id>
<content type='text'>
Flush the output log up to the root when a test panics. Prior to
this change, only the current test's output log was flushed to its
parent, resulting in no output when a subtest panics.

For the following test function:

	func Test(t *testing.T) {
		for i, test := range []int{1, 0, 2} {
			t.Run(fmt.Sprintf("%v/%v", i, test), func(t *testing.T) {
				_ = 1 / test
			})
		}
	}

Output before this change:

	panic: runtime error: integer divide by zero [recovered]
		panic: runtime error: integer divide by zero
	(stack trace follows)

Output after this change:

	--- FAIL: Test (0.00s)
	    --- FAIL: Test/1/0 (0.00s)
	panic: runtime error: integer divide by zero [recovered]
	(stack trace follows)

Fixes #32121

Change-Id: Ifee07ccc005f0493a902190a8be734943123b6b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/179599
Run-TryBot: Damien Neil &lt;dneil@google.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
</entry>
</feed>
