我正在使用Apple LLVM Compiler 4.1在Xcode 4.5上運行的iOS項目上生成代碼覆蓋數據文件(.gdca和.gcno)。如何使用gcovr爲iOS生成Cobertura格式的xml文件?
在Library/Developer/Xcode/DerivedData/viewer-evgaabclrjcouydwveuptwroeofm/Build/Intermediates/viewer.build/Coverage-iphonesimulator/viewer_generic/viewer_generic.build/Objects-normal/i386下正在生成文件。
所有(.o,.d,.dia,.gcda,.gdno)文件都位於此目錄下。沒有子文件夾。
我可以使用Cover Story打開單個的.gcda文件。現在我想生成一個可以使用cobertura查看的報告。
我想爲此使用gcovr。在終端我到上面的文件夾
Command: gcovr -r `pwd` -x -v
Output:
(Several lines of similar output as below)
Running gcov: 'gcov /Users/abc/Library/Developer/Xcode/DerivedData/viewer-evgaabclrjcouydwveuptwroeofm/Build/Intermediates/viewer.build/Coverage-iphonesimulator/viewer_generic/viewer_generic.build/Objects-normal/i386/FILE_NAME.gcda --branch-counts --branch-probabilities --preserve-paths --object-directory /Users/abc/Library/Developer/Xcode/DerivedData/viewer-evgaabclrjcouydwveuptwroeofm/Build/Intermediates/viewer.build/Coverage-iphonesimulator/viewer_generic/viewer_generic.build/Objects-normal/i386' in '/Users/abc/Library/Developer/Xcode/DerivedData/viewer-evgaabclrjcouydwveuptwroeofm/Build/Intermediates/viewer.build/Coverage-iphonesimulator/viewer_generic/viewer_generic.build/Objects-normal/i386'
Parsing coverage data for file /Users/abc/Documents/Perforce/DPS-MacBookPro/depot/sandbox/Viewer-Labatt/Blue/viewers/ipadviewer/iphone/apps/viewer/Classes/view/zooming/FILE_NAME.mm
Filtering coverage data for file /Users/abc/Documents/Perforce/DPS-MacBookPro/depot/sandbox/Viewer-Labatt/Blue/viewers/ipadviewer/iphone/apps/viewer/Classes/view/zooming/FILE_NAME.mm
Gathered coveraged data for 0 files
<?xml version="1.0" ?>
<!DOCTYPE coverage
SYSTEM 'http://cobertura.sourceforge.net/xml/coverage-03.dtd'>
<coverage branch-rate="0.0" line-rate="0.0" timestamp="1354144430" version="gcovr 2.4 (r2774)">
<sources>
<source>
/Users/abc/Library/Developer/Xcode/DerivedData/viewer-evgaabclrjcouydwveuptwroeofm/Build/Intermediates/viewer.build/Coverage-iphonesimulator/viewer_generic/viewer_generic.build/Objects-normal/i386
</source>
</sources>
<packages/>
</coverage>
我看到一個警告:gcno:版本「404」,喜歡「402」
請幫我找出原因gcovr無法生成報表。
嗨,你是否能夠做到這一點? –