Xcode 7.0 and 7.1, code protection enabled, unit test crash "cannot merge previous GCDA file: damaged arc tag"

We had this problem since Xcode 7 beta strong>, and this problem persists to this day with Xcode 7.1 .

Basically, we cannot enable code coverage in Xcode. In Xcode 6, this worked fine, but was interrupted with Xcode 7. At the end of the unit test run, we get endless console output saying:

profiling: /Users/<my path to app>/ObjectiveC.gcda: cannot merge previous GCDA file: corrupt arc tag (<some hex address>) 

This result is repeated until the application crashes . I just don’t know why this is happening, and all attempts to fix this problem have failed (with the exception of disabling program threads and disabling code coverage). I even tried setting up the script build phase, which finds and cleans up previous code coverage files, but that didn't work either.

Has anyone figured this out?

+5
source share
2 answers

Thanks to @gagarwal for the direction. I just need to figure out another jenkins reporting tool, as I need old files to cover the code, but I believe this is no longer supported. Here are a few screenshots to illustrate the setting that generates code coverage reports visible in Xcode based on gagarwal suggestions:

 ---------------------- main app target config ---------------------- 

enter image description here enter image description here

 ---------------------- test app target config ---------------------- 

enter image description here enter image description here

 ------------------------------------------ Scheme config (see "Gather coverage data") ------------------------------------------ 

enter image description here

+2
source

New Xcode 7 code coverage features use the LLVM coverage format .

Xcode 7 also has new build settings for code coverage: "CLANG_ENABLE_CODE_COVERAGE"

Verify that CLANG_ENABLE_CODE_COVERAGE is set to YES and NO:

GCC_GENERATE_TEST_COVERAGE_FILES = NO; GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO;

+1
source

Source: https://habr.com/ru/post/1234315/


All Articles