[英]Why does Cobertura report 0% coverage when run through the Eclipse plugin?
(這些問題有很多,但我能找到的所有問題都與Maven有關。在你提出這個問題之前,請先了解一下,請理解這與Maven沒有任何關系。)
我在Eclipse中使用Cobertura來確定我的JUnit測試所涵蓋的代碼百分比。 所有99個單元測試都在Cobertura內外成功運行,但Cobertura報告稱他們已經覆蓋了我的代碼的0%。
一世 :
為什么Cobertura報告0%?
我發現這對我來說是一個問題因為我正在編譯沒有行號的源文件。 如果這是你的問題,你會看到
[cobertura-instrument] WARN visitEnd, No line number information found for class com.x.y.z.A.
Perhaps you need to compile with debug=true?
要解決此問題,請在您的javac
命令中添加debug="true" debuglevel="vars,lines,source"
。
也可以看看:
http://meera-subbarao.blogspot.co.uk/2008/07/cobertura-instrument-warn-visitend-no.html
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.