Is it possible to post coverage for multiple packages to Coveralls?

前端 未结 6 653
故里飘歌
故里飘歌 2021-02-04 10:02

I want to track test coverage on a go project using Coveralls, the instructions for the integration reference using https://github.com/mattn/goveralls

cd $GOPA         


        
6条回答
  •  时光说笑
    2021-02-04 10:23

    Has anyone figured out how to get coverage for multiple packages?

    Note: with Go 1.10 (Q1 2018), that... will actually be possible.
    See CL 76875

    cmd/go: allow -coverprofile with multiple packages being tested

    You can see the implementation of a multiple package code coverage test in commit 283558e


    Jeff Martin has since the release of Go 1.10 (Feb. 2018) confirmed in the comments:

    • go test -v -cover ./pkgA/... ./pkgB/... -coverprofile=cover.out gets a good profile and
    • go tool cover -func "cover.out" will get a total: (statements) 52.5%.

    So it is working!

提交回复
热议问题