Golang测试覆盖范围时测试文件外部包装
我正在尝试使用测试目录中的测试文件在处理器软件包中获得正确的代码覆盖量。我尝试了许多组合和-Coverpkg的组合,并且无法使其正常工作。在单独的软件包/文件夹中将测试文件放入时可以做到吗?
.
├── internal
│ └── processor
└── test
I am trying to get the proper coverage amount of my code in the processor package using my test files that are in the test directory. I've tried numerous combinations of -cover and -coverpkg and cannot get it to work correctly. Can this be done while having the test files in separate package/folder?
.
├── internal
│ └── processor
└── test
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我跟踪了一个答案,这就是我能够实现目标的方式:
基于 cmd/ GO,测试标志,标志用法是:
-coverpkg模式1,dattery2,tatter2
I tracked down an answer and this is how I was able to accomplish my goal:
Based on cmd/go, Testing Flags, the flag usage is:
-coverpkg pattern1,pattern2,pattern3