I have unit tests in xcode 5.1, ios7.1, when I run them via the test command within xcode I can see gcda and gcdo files generated in the appropriate place. When I invoke the test command via the command line I only get gcdo files. It must be something to do with the __gcov_flush
method that needs to be called to generate the files (I put logs in the flush method I see it in the gui logs but not the terminal logs). I used help from these SO questions
- Code coverage from command line
- Followed basically all of this one
I have also followed the usual advice and set
Generate Test Coverage Files: YES
Instrument Program Flow: YES
At a project level.
My command:
xcodebuild -workspace "$WORKSPACE" -scheme "$SCHEME" -configuration Debug -sdk $IPHONESIMULATOR_VERSION ONLY_ACTIVE_ARCH=YES clean build test
Is there a reason why it would work within xcode but not via the command line?