]> Cypherpunks repositories - gostls13.git/commit
internal/coverage: add apis for reading/writing counter data
authorThan McIntosh <thanm@google.com>
Thu, 28 Oct 2021 16:24:31 +0000 (12:24 -0400)
committerThan McIntosh <thanm@google.com>
Mon, 26 Sep 2022 21:48:18 +0000 (21:48 +0000)
commitefa3f1749fabe3b3062edff7651baa8cb1f574ab
treef44441fac23b9ef0aaeaca09b03cdbec32dbcc82
parent63668a5155c808f474d5adab676ef3f3aa50c1d3
internal/coverage: add apis for reading/writing counter data

Add utilities for reading and writing of counter data files as part of
the new code coverage implementation.

Trivia note: currently the contents of counter data files are emitted
in little-endian form, which for the counters is somewhat painful in
that we need to visit each counter value and properly encode it. It
might be better to instead emit counters in native endianity and then
teach the tools to decode properly in the case of an endianity
mismatch.

Updates #51430.

Change-Id: I124fdcb40fc339a48b64b35264bf24c3be50ddd4
Reviewed-on: https://go-review.googlesource.com/c/go/+/359403
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
src/go/build/deps_test.go
src/internal/coverage/decodecounter/decodecounterfile.go [new file with mode: 0644]
src/internal/coverage/encodecounter/encode.go [new file with mode: 0644]
src/internal/coverage/stringtab/stringtab.go
src/internal/coverage/test/counter_test.go [new file with mode: 0644]
src/internal/coverage/test/roundtrip_test.go