7
我在macosx平臺中使用gcov進行覆蓋測試。我完成了配置的Xcode由集:有沒有辦法將兩個gcov文件合併爲一個
1. Build Settings ==> Generate Test Coverage Files == Yes
2. Build Settings ==> Instrument Progaram Flow == Yes
3. Build Phases ==> Link Binary with library ==> add "libprofile_rt.dylib"
然後生成文件「Test.d, Test.dia, Test.gcno, Test.gcda, Test.o
」 然後我用gcov-4.2 -b Test.gcno
命令生成Test.m.gcov
文件(這是我想要什麼),但是當我運行測試用例下一次再次生成文件「Test.d, Test.dia, Test.gcno, Test.gcda, Test.o
」,數據將被重置。
所以我有兩個問題:
- 有什麼辦法,我要在積累這些覆蓋文件中的數據,這樣我可以運行我的項目這麼多次,然後在接收端生成的文件。
如果#1無望,你能告訴我如何將
merge two Test.gcno
文件(由兩次運行生成)合併爲一個文件。我嘗試的gcov在終端,下面是對gcov命令的選項:gcov-4.2 -help Usage: gcov [OPTION]... SOURCEFILE Print code coverage information. -h, --help Print this help, then exit -v, --version Print version number, then exit -a, --all-blocks Show information for every basic block -b, --branch-probabilities Include branch probabilities in output -c, --branch-counts Given counts of branches taken rather than percentages -n, --no-output Do not create an output file -l, --long-file-names Use long output file names for included source files -f, --function-summaries Output summaries for each function -o, --object-directory DIR|FILE Search for object files in DIR or called FILE -p, --preserve-paths Preserve all pathname components -u, --unconditional-branches Show unconditional branch counts too For bug reporting instructions, please see: <URL:http://developer.apple.com/bugreporter>.
感謝提前你的幫助