英文:
How to get code coverage using gb?
问题
运行gb:
gb test .../<regex>/... -v
是可以的,但是运行gb test .../<regex>/... -coverprofile=cover.out
会出现以下错误:
testing: cannot use -test.coverprofile because test binary was not built with coverage enabled
而go test -coverprofile cover.out
是可以的。如何在使用gb时获取代码覆盖率?
英文:
Running gb:
gb test .../<regex>/... -v
works, but running gb test .../<regex>/... -coverprofile=cover.out
results in:
testing: cannot use -test.coverprofile because test binary was not built with coverage enabled
while go test -coverprofile cover.out
works. How to get code coverage using gb as well?
答案1
得分: 1
-coverprofile
标志在gb中尚不受支持。
您可以在https://github.com/constabulary/gb/issues/367上查看状态。
那里还发布了一个解决方法,您可以使用。
英文:
-coverprofile
flag is not supported in gb yet.
You can check the status at https://github.com/constabulary/gb/issues/367.
There is also a workaround posted there, which you can use.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论