title: Annoying error message: cannot merge previous GCDA file
body: <p><strong>Problem</strong>:</p>
  
  <p>I'm using the following flags to generate the code coverage of my <strong>Qt</strong> application (<code>.pro</code> file):</p>
  
  <pre><code>QMAKE_CXXFLAGS += --coverage
  QMAKE_LFLAGS += --coverage
  </code></pre>
  
  <p>The code coverage is correctly generated, the problem is that if I want to run only one test function/class (and the <strong>GCDA</strong> files were already created) I get the following error message:</p>
  
  <pre><code>profiling: /Users/user/.../build-myapp/myclass.gcda: cannot merge previous GCDA file: corrupt arc tag (0x00000000)
  </code></pre>
  
  <p>Note that the error message is shown for each <strong>GCDA</strong> file. Also, note that it doesn't seem to affect the test cases.</p>
  
  <hr>
  
  <p><strong>Workaround</strong>:</p>
  
  <p>As explained <a href="https://stackoverflow.com/questions/22519530/dozens-of-profilinginvalid-arc-tag-when-running-code-coverage-in-xcode-5">here</a>, it "<em>is a result of the build tools failing to merge current results into the existing .gcda coverage files</em>". As answered in the question, an option is to delete the GCDA files before running the tests. For example, by adding the following command in the build phase:</p>
  
  <pre><code>find . -name "*.gcda" -print0 | xargs -0 rm
  </code></pre>
  
  <hr>
  
  <p><strong>Question</strong>:</p>
  
  <p>My problem is that I don't want to delete the old GCDA files every time I run the test cases. As I'm running only one test function/class, I want to keep the old GCDA files as they are, and only merge the GCDA file related to the current class. As I manually checked, it is already being done because only the coverage of my current class is updated, and the old coverages remain the same.</p>
  
  <p><strong>So, is there a command to just ignore (don't show) the error messages related to the GCDA merging problems? Or even better, a command to only update the GCDA files related to the current test class?</strong></p>
  
  <p><strong>Note</strong>: I'm using Qt 5.3.2 on macOS Sierra with Clang.</p>
  
  <hr>
  
  <p><strong>Related questions</strong>:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/41936659/code-coverage-warrnings-spam-output">Code coverage warnings spam output</a></li>
  <li><a href="https://stackoverflow.com/questions/25059435/how-to-merge-multiple-versions-of-gcda-files">How to merge multiple versions of gcda files?</a></li>
  <li><a href="https://stackoverflow.com/questions/38492859/gcda-files-dont-merge-on-multiple-runs">.gcda files don't merge on multiple runs</a></li>
  </ul>