]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/amd64: fix for coverage testing
authorThan McIntosh <thanm@google.com>
Mon, 13 Dec 2021 17:03:13 +0000 (12:03 -0500)
committerThan McIntosh <thanm@google.com>
Mon, 13 Dec 2021 19:08:31 +0000 (19:08 +0000)
commit3e8aa5dd495d30ff29cd4fb78aabe8fc0ebb1eda
tree2bcc9ea2a5d116504a9d04da7dd103806b51beed
parentf909f813a0c12fde089a6c5e18fdcb9e71759cf7
cmd/compile/internal/amd64: fix for coverage testing

Fix up a unit test to make it more friendly for coverage runs.
Currently on tip if you do

   cd ${GOROOT}/src ; go test -cover cmd/compile/...

it will cause a failure in the TestGoAMD64v1 testpoint of
cmd/compile/internal/amd64, the reason being that this testpoint
copies and reruns the test executable, expecting the rerun to produce
only the output "PASS", whereas if "-cover" is used, the output will
include percentage of statements covered as well. To fix, rework the
test to tolerate additional output if coverage is enabled.

Change-Id: I2512e06ca06e5f38108f2891ff84276d148c4f9e
Reviewed-on: https://go-review.googlesource.com/c/go/+/371234
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/amd64/versions_test.go