Friday, 15 May 2015

objective c - GCovr does not generate a valid report -


I want to set up my Jenkins with Cobertura to track code coverage. Unfortunately I can not generate a valid XML

I am using.

  • Pre-release gcovr 2.5 (r2774)
  • Xcode 4.6.1 build version 4h 512

    My project code coverage files Is correctly prepared, but the report created with GCOVR is not useful

    The order I use to generate the report:

      gcovr -r / Users / Share / Jenkins / Home / Jobs / CodeCoverage / Workbench --object-directory / Users / Shared / Jenkins / Home / Library / Developer / Xcode / DerivedData / MyProject-aooceqwwovrizceerghqvhfl Cfty // creation / intermediate / myProject.build / development / myProject.build '* developer .. * '/ Objects Normal / x86_64 --exclude --exclude' * Test *.' --xml   

    This will generate this output to me:

        

    If I delete --object-directory and -r and then I execute the command from the derived data directory, a valid report is generated from this report from Cobertura Can be read but can not show any detailed information about source files.

    While working with XCode, I have found that $ WORKSPACE / build Construction Directory helps with this problem keeps this derived data directory out of it, and also keeps my object files neatly in the build object. It also prevents two builds from interfering with each other.

    If using the Xcode build tool, set the SYMROOT to the $ WORKSPACE / build configuration tool in the creation of the device. If you are building from the command line, then set it manually on the command line or in the environment.

    Then a gcovr script such as:

      / your / path / to / gcovr -r - object-directory build / your app.bild / coverage - ifoisimulator / yourApp .build / Object-Normal / i386 --xml & gt; Build / coverage.xml   

    (Your path may vary slightly depending on your build style, call, etc.)

    And finally in Cobertura config, The point build / coverage.xml , and when you use the tool within Jenkins, you should get the annotated source.

    I should be working in the small field of Mac Mini, really happy with that configuration.

No comments:

Post a Comment