9

so the hot new feature in Xcode 7 is code coverage integrated within XCode - yaaay! With this new feature also comes Apple's new code coverage format .profdata.

We need to display code coverage reports in Cobertura reports (loaded in Jenkins). Currently there is no way to convert .profdata to Cobertura XML report (it is on its way however).

Until then, we need to rely on the "old" gcov. For some unknown reason XCode 7 generates .gcno and .gcda, BUT when you let gcovr to create the Cobertura reports it shows 0% coverage for all files (we surely have some coverage).

We tried to go back to XCode 6.4 and the generated gcov files shows the right coverage when run through gcovr.

Is anyone experiencing the same problem? Any possible solutions?

2 Answers2

0

gcovr should be executed from the folder where the .gcda and .gcno files exist. And the root path is the folder where the source files(.c or .cpp) exist.

With this, the command looks like something as shown below.

rr-mac:gcdaFolder$ gcovr -r /path_to_C_sourceFiles/ .

For output html file below command works

rr-mac:gcdaFolder$ gcovr --html -o Filename_rp.html -r /path_to_C_sourceFiles/ .

Note: The dot(.) at the end is mandatory

-1

Set next values in Build Settings of your target:

Generate Legacy Test Coverage Data = YES
Instrument Program Flow = YES
Enable Code Coverage Support = NO
Ossir
  • 3,109
  • 1
  • 34
  • 52