Code coverage measurement

104 views
Skip to first unread message

alex.be...@gmail.com

unread,
Oct 1, 2018, 1:15:41 PM10/1/18
to golang-dev
Hi!

Go has pretty good code coverage measurement infrastructure for unit test. However there seems to be distinct lack of code coverage support for regular non-test binaries. This prevents coverage measurement for integration tests or human-guided tests.

There is a commonly used workaround - a fake unit test that simply runs the main function of the target directly. But this really seems awkward and limiting.

Is there an interest in a formal proposal to add code coverage gathering mode as a "go build" flag? I'm thinking about something like a "-cover" flag that enables the code to output coverage information into a file specified by COVERAGE_OUTPUT environment variable.
Reply all
Reply to author
Forward
0 new messages