我有問題可以在Xcode 7中爲某個iOS項目獲取代碼覆蓋率報告。Xcode 7代碼覆蓋率報告不起作用
我按照這裏給出的說明: http://mgrebenets.github.io/mobile%20ci/2015/09/21/code-coverage-for-ios-xcode-7/
三個項目我嘗試中,有兩個工作正常,但一個項目是讓我頭疼。當使用LLVM冠狀病毒工具來生成從所收集的個人資料數據像這樣的報告:
xcrun llvm-cov report -instr-profile Coverage.profdata MyAppBinary
我收到錯誤消息:
error: Failed to load coverage: The file was not recognized as a valid object file
我檢查了「收集覆蓋數據」爲啓用測試方案。我還檢查了-fprofile-instr-generate和-fcoverage-mapping編譯器選項是否傳遞給了clang。
文件大小和類型也期待有效的對我說:
ilMac:llvm-cov-test ilja$ ls -la
total 61976
drwxr-xr-x 4 ilja staff 136 14 Okt 21:53 .
drwxr-xr-x+ 75 ilja staff 2550 14 Okt 16:31 ..
-rw-r--r-- 1 ilja staff 1797416 14 Okt 21:53 Coverage.profdata
-rwxr-xr-x 1 ilja staff 29932040 14 Okt 16:32 MyAppBinary
ilMac:llvm-cov-test ilja$ file Coverage.profdata
Coverage.profdata: data
ilMac:llvm-cov-test ilja$ file MyAppBinary
MyAppBinary: Mach-O universal binary with 2 architectures
MyAppBinary (for architecture i386): Mach-O executable i386
MyAppBinary (for architecture x86_64): Mach-O 64-bit executable x86_64
我也注意到,在Xcode的試運行,「覆蓋」選項卡在說「不覆蓋數據」,而不是指示條。
任何想法我做錯了什麼?
我試圖遵循相同的文章,並有同樣的錯誤。你有解決這個問題嗎?如果是的話可以幫我嗎?提前致謝!!! – Roma