2
我的主項目是一個android庫。 我已經創建了一個測試項目,其中包含一些單元測試。 測試運行良好,但我努力獲得測試覆蓋率。 當我生成覆蓋率報告時,我只能得到測試用例的覆蓋範圍 而不是庫。 因此,它幾乎100%,因爲100%的測試正在運行。 但這並不能幫助我判斷圖書館的哪些部分已經過測試。什麼是檢查android庫測試覆蓋率的正確方法?
這是我如何做到這一點的時刻:
0) my project looks like this:
myLibraryProject <- this is my android library project
myLibraryProject/tests <- this is my android test project
1) build.xml file : (from myLibraryProject/tests directory)
>android update test-project --path . -m ../
2) Modify the ant.properties file :
#tested.project.dir=../
android.library.reference.1=..
3) only then can I run :
ant emma debug install test
,如果我不這樣做第2步),則步驟3)失敗,因爲庫項目不能安裝
任何幫助將真的很感激!