Helper for running integration tests for Golang apps with coverage.
Install gocovmerge first.
bash get github.com/reconquest/go-test
var exit = os.Exit
All following exit's should be done via function exit
.
Importing via imports.bash
import:use github.com/reconquest/go-test
...
include vendor/github.com/reconquest/go-test.bash/Makefile
# after import
go-test:set-output-dir "$(pwd)"
go-test:build <target-exe-name>
# after import & build
go-test:run <target-exe-name> [<args>]
# after import & run
go-test:merge-coverage
To open browser with coverage web-interface:
make coverage.html
To see text report:
make coverage.report
After that step coverage will be available at coverage.html file.
Current implementation will not preserve error exit code (>0) and any exit
code >0 will cause program to exit
with exit code of 1.
Program should end all it's goroutines correctly before calling exit. Otherwise, this implementation will hang in waiting goroutines to finish.