Hello all
You can now generate coverage reports for Go commands and tests using gccgo and lcov!
lcov actually needs a bugfix, which is available in the Fedora package:
The lcov author should release a fixed version soon:
Steps:
cd ~/myproj
rm -rf go-build* html
TMPDIR=`pwd` GOPATH=`pwd` go test -compiler=gccgo -gccgoflags '--coverage -g -O0' -v -work ./...
lcov --directory go-build* --capture --output-file
myproj.info
You can also produce reports understood by the Jenkins Cobertura plugin using gcovr:
You might have to tweak one line in gcovr:
output_re = re.compile("[cC]reating [`'](.*)'$")
Make sure you have the latest gccgo and go from tip.
Some example output here:
Regards,
Albert
P.S. A few issues to watch out for: