code coverage with gcovr and Xcode 5 is not working

前端 未结 2 956
逝去的感伤
逝去的感伤 2021-02-06 00:54

I\'m using gcovr to generate code coverage for cobertura. Everything was working fine with xcode 4.6. Now I updated to xcode5 and everything I get is 0% coverage...

my

2条回答
  •  我在风中等你
    2021-02-06 01:23

    At first make sure that your .gcda and .gcno files are created!

    (Check: ~/Library/Developer/Xcode/DerivedData/{YOUR-PROJECT-NAME}/Build/Intermediates/{YOUR-PROJECT-NAME}.build/Debug-iphonesimulator/{YOUR-PROJECT-NAME}.build/Objects-normal/i386 )

    If they have been successfully created you need to do the following: (If not check the comments under your question)

    1. copy the all the files from the folder i386 (full path as described above) into you workspace where your .h and .m files are.

    2. run terminal and change you parent working directory to your workspace

       cd [YOUR WORKSPACE PATH]
      
    3. run gcovr

       gcovr -r . --xml  > reports/coverage.xml
      

    If you are using jenkins (which i assume) this will be your further steps: Generating gcda files to view the code-coverage from XCTests in IOS with Jenkins

    Let me know if you still have questions!

提交回复
热议问题