Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 cobertura,但它给了我 100% 的线路覆盖率。它只显示那些执行的代码行?
在运行测试之前尝试删除文件cobertura.ser 。
https://github.com/cobertura/cobertura/wiki/FAQ
当您使用报告任务时,您需要包括源(或确保它们被包括在内):
<cobertura-report format="html" destdir="${coveragereport.dir}" srcdir="${src.dir}" />
参考:cobertura-anttask
否则 cobertura 无法知道实际存在多少行/类,并将报告 100% 的覆盖率。