Giter Site home page Giter Site logo

xcodecoverage's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xcodecoverage's Issues

Unable to see coverage report in XCode 12.4 with new build system

Unable to see coverage report in XCode 12.4 with new build system. Please see below error

15:21:19 + mkdir -p ../../build/reports/coverage_Report
15:21:19 + echo 'XcodeCoverage report generating..'
15:21:19 XcodeCoverage report generating..
15:21:19 + XcodeCoverage/getcov -o ../../build/reports/coverage_Report
15:21:19 output_dir = ../../build/reports/coverage_Report
15:21:19 /opt/jenkins/workspace/iOS_PullRequest_Unit/build/reports/coverage_Report /opt/jenkins/workspace/iOS_PullRequest_Unit/src/elektra
15:21:19 /opt/jenkins/workspace/iOS_PullRequest_Unit/src/elektra
15:21:19 Capturing coverage data from /Users/jenkins/Library/Developer/Xcode/DerivedData/elektra-dqgphexvdqtbmicihhexfohtaasc/Build/Intermediates.noindex/elektra.build/Debug_Fluke-iphonesimulator/elektra.build/Objects-normal/undefined_arch
15:21:19 Found LLVM gcov version 12.0.0, which emulates gcov version 4.2.0
15:21:19 geninfo: ERROR: cannot read /Users/jenkins/Library/Developer/Xcode/DerivedData/elektra-dqgphexvdqtbmicihhexfohtaasc/Build/Intermediates.noindex/elektra.build/Debug_Fluke-iphonesimulator/elektra.build/Objects-normal/undefined_arch!
15:21:19 lcov: ERROR: cannot read file Coverage.info!
15:21:19 Reading tracefile Coverage.info

Segmentation fault when gathering coverage with getcov

I'm getting the following error when gathering coverage with getcov:

Capturing coverage data from .build/Release-iphonesimulator/Supervisor-cal.build/Objects-normal/i386
Found gcov version: 4.2.1
Found 180 data files in .build/Release-iphonesimulator/Supervisor-cal.build/Objects-normal/i386
Processing i386/AboutViewController.gcda
Processing i386/Agent.gcda
Processing i386/AgentStatsGridController.gcda
Processing i386/AppDelegate.gcda
Stack dump:
0.      Program arguments: /usr/bin/gcov .build/Release-iphonesimulator/Supervisor-cal.build/Objects-normal/i386/AppDelegate.gcda -o .build/Release-iphonesimulator/Supervisor-cal.build/Objects-normal/i386

.gcda is not generated

I don't know if it issue of XcodeCoverage or Xcode itself.

I have target with name 'app develop'. If I run test I don't see .gcda files generated. If I run tests for 'app' target everything works.

Except of renaming target are there solutions?

How to set the specified files to whitelist

How to set the specified files to whitelist?
i want to add some files to whitelist, and only Check these files。
our project is very big. and contain so many sdks, usually one feature we only chang A few files, i only want to check that files. don't care others files. What should I do?
thanks, waitting for your replay!

How to get coverage infos after running instrumentation or manually manipulating the app

Hi,
After building the app, getting the gcno files and launching the app, I manually operated on the app and then closed the simulator. Then I got the hint that where I want to generate the coverage files and I clicked yes. After that, I manually ran the getcov file but I got the error msg "GCov_Build-iphoneos/lcov/index.html does not exist".
Which did I miss?

Unable to see coverage report in XCode 11.6 with new build system.

Unable to see coverage report in XCode 11.6 with new build system. Please see below error

11:00:18 + mkdir -p ../../build/reports/coverage_Report
11:00:18 + echo 'XcodeCoverage report generating..'
11:00:18 XcodeCoverage report generating..
11:00:18 + XcodeCoverage/getcov -o ../../build/reports/coverage_Report
11:00:18 output_dir = ../../build/reports/coverage_Report
11:00:18 /opt/jenkins/workspace/iOS_PullRequest_Unit/build/reports/coverage_Report /opt/jenkins/workspace/iOS_PullRequest_Unit/src/elektra
11:00:18 /opt/jenkins/workspace/iOS_PullRequest_Unit/src/elektra
11:00:18 Capturing coverage data from /Users/jenkins/Library/Developer/Xcode/DerivedData/elektra-dqgphexvdqtbmicihhexfohtaasc/Build/Intermediates.noindex/elektra.build/Debug_Fluke-iphonesimulator/elektra.build/Objects-normal/undefined_arch
11:00:18 Found LLVM gcov version 11.0.3, which emulates gcov version 4.2.0
11:00:18 geninfo: ERROR: cannot read /Users/jenkins/Library/Developer/Xcode/DerivedData/elektra-dqgphexvdqtbmicihhexfohtaasc/Build/Intermediates.noindex/elektra.build/Debug_Fluke-iphonesimulator/elektra.build/Objects-normal/undefined_arch!
11:00:18 lcov: ERROR: cannot read file Coverage.info!
11:00:18 Reading tracefile Coverage.info

Unable to generate code coverage with Xcode 10 Beta

HI,

I am generating Code coverage using terminal after test cases succeed by running run_code_coverage_post.sh. It works fine with Xcode 10.4.1, but on Xcode 10 beta it's giving below errors: Please help me in resolving these this issue.

geninfo: ERROR: cannot read /Users/Abhishek/Library/Developer/Xcode/DerivedData/TRADFRI-fuzpwmjhzkdzrbbfjbnlwglkcolz/Build/Intermediates.noindex/TRADFRI_LIB.build/Debug-iphonesimulator/TRADFRI_LIBTests.build/Objects-normal/undefined_arch!
Reading tracefile Coverage.info
lcov: ERROR: cannot read file Coverage.info!
Reading tracefile Coverage.info
lcov: ERROR: cannot read file Coverage.info!
cat: /Users/Abhishek/Documents/Usman/LSProject/tradfri-ios/External/FREKVENS_LIB/.xcodecoverageignore: No such file or directory
Reading tracefile Coverage.info
lcov: ERROR: cannot read file Coverage.info!
Reading data file Coverage.info
genhtml: ERROR: cannot read file Coverage.info!
The file /Users/Abhishek/Library/Developer/Xcode/DerivedData/TRADFRI-fuzpwmjhzkdzrbbfjbnlwglkcolz/Build/Products/Debug-iphonesimulator/lcov/index.html does not exist.

Thanks and Regards,
Usman Ansari

Using xcodecoverage for the real device?

Hi,
I'm able to export a nice report for test running on simulator.
But when trying with the actual device, I always get the following errors:
"Reading tracefile Coverage.info
lcov: ERROR: no valid records found in tracefile Coverage.info"

Any suggestion? Thank you

exportenv.sh is failing to create env.sh on a TeamCity CI Server

I'm able to successfully run and build my project using a standard installation of XcodeCoverage on a local instance on my machine.

However, our TeamCity CI Server (Mac Mini OSX 10.10 with Xcode) is unable to successfully execute the exportenv.sh script. This results in a null env.sh which then causes some additional libraries to fail (fabric io specifically) thus causing compile errors.

There really isn't much of an error being posted to console output either, it simply says

"[13:33:47]Step 2/6: export env.sh (Command Line)
[13:33:47][Step 2/6] Starting: /Library/TeamCity/buildAgent/temp/agentTmp/custom_script9004978931224840444
[13:33:47][Step 2/6] in directory: /Library/TeamCity/buildAgent/work/c611c1ea3bea1202
[13:33:47][Step 2/6] Process exited with code 1
[13:33:47][Step 2/6] Step export env.sh (Command Line) failed"

I've reviewed the actual script and I don't see any errors or mistakes, it also hasn't been modified.

Is there anything that I should be calling/running before calling exportenv.sh I know there are a handful of build scripts in there. Any help is very much appreciated!

Xcode 8 Support

Hi, jonreid,I found the XcodeCoverage cannot work for Xcode 8GM

XcodeCoverage/env.sh: No such file or directory

I'm getting the following error when trying to run XcodeCoverage

[ProjectName]/Libraries/XcodeCoverage/exportenv.sh: line 7: XcodeCoverage/env.sh: No such file or directory

My directory structure is as follows

  • [ProjectName].xcodeproj
  • [ProjectName]
  • [ProjectName] / Libraries
  • [ProjectName] / Libraries / XcodeCoverage

I have used the following script command "[ProjectName]/Libraries/XcodeCoverage/exportenv.sh"

I am using Xcode 4.6.

I have not added any of the files to the actual project just placed them within the folder. Either way it can see the script, just can't access the env.sh file

Swift support

Hi Jon,

I hope you're doing well. I only see objective-c files in my test coverage report. Does this project support Swift ?

Thanks,
Alex

exportenv.sh always exports i386

I just noticed an issue when trying to run my tests against a 64bit simulator e.g. an iPhone 6 simulator.
Then the script always puts i386 as CURRENT_ARCH into the env.sh file.
Might this be an issue I'm having with my build settings or does anyone know another way to fix this? Thanks!

NAming convention to create .xcodecoverageignore

Hi All,
Could you please help in filtering files in code coverage , as explained in documentation created a file.xcodecoverageignore, but there is no luck in filtering, so please help .

Thanks
Praveen kanike

No unit test coverage, but AppDeledate coverage

I installed XcodeCoverage to my project like descriped in README.md. I tried pods and standard installation and had always the same effect:

  • code coverage on every line which were executed by the app delegate before the unit tests started
  • no code coverage on lines which were executed by the unit tests

I already asked Google but didn't get an answer that worked. I also tried the __gcov_flush() function, but no effect neither.

I use Xcode6, iOS simulator 8.3 and 8.4.

Any ideas?

Doesn’t properly handle spaces in path

It the path containing XcodeCoverage contains spaces, cleancov and getcov truncate the path at the first space. For example, if XcodeCoverage is located at /Users/Foo/Bar Baz/, the aforesaid scripts return an error stating /Users/Foo/Bar: No such file or directory.

<app>.build vs <app>Tests.build directories?

What's the difference between the coverage files (.gcda and .gcno) in these two directories:

DerivedData/<app>/Build/Intermediates/<app>.build/Debug-iphonesimulator/**<app>Tests.build**/Objects-normal/i386/

vs

DerivedData/<app>/Build/Intermediates/<app>.build/Debug-iphonesimulator/**<app>.build**/Objects-normal/i386/

I see that your script reports the coverage numbers from the 2nd directory. What's the difference? Why did you choose one over the other? I have vastly different coverage metrics when I compare what's reported from either of those.

when i run unit test and then run getcov it's given error

geninfo: Can't exec "/Volumes/Data": No such file or directory at /Volumes/Data Backup/Code covarage Demo/covarageDemo/Pods/XcodeCoverage/lcov-1.13/bin/geninfo line 1965.
geninfo: ERROR: cannot retrieve gcov version!
Reading tracefile Coverage.info
lcov: ERROR: cannot read file Coverage.info!
Reading tracefile Coverage.info
lcov: ERROR: cannot read file Coverage.info!
cat: /Volumes/Data Backup/Code covarage Demo/covarageDemo/.xcodecoverageignore: No such file or directory
Reading tracefile Coverage.info
lcov: ERROR: cannot read file Coverage.info!
Reading data file Coverage.info
genhtml: ERROR: cannot read file Coverage.info!
logout

XCode 7 is not supported

When running on XCode 7 I get:

lcov: ERROR: no valid records found in tracefile Coverage.info
Reading data file Coverage.info
genhtml: ERROR: no valid records found in tracefile Coverage.info
Coverage report is in lcov folder

Unexpected number of functions & Unexpected number of edges

Hi,
I really liked your tool to get html version coverage report, but I've been getting Unexpected number of edges and Unexpected number of functions errors when I tried to generate report for my unit test, also the xcodecoverageignore file is not working as expected, an sample is ${SRCROOT}/../../../../android/sdk/src/main/jni/source/sqlite3.c.
Please advise thanks.

Installer/Binary?

I'd rather not add this to my project folder. Is there a way to put this into my path, and call it from Xcode?

Code coverage in Xcode without tests (for manual run)

Code Coverage is commonly used with tests in Xcode. I would like to use it for manually executed app. Can I do it, possibly with third-party tools?

For example: I build and launch the app on device, perform some actions with it and then look at code coverage results.

before Xcode7. The way we achieved this was, to set the "Instrument Program Flow" and "Generate Test Coverage files" flags to Yes, on your project, and later add a "flush" code somewhere inside you application, to write the coverage data files. This "flushing" part actually writes the coverage data files, which can be used later by other tools such as gcovr or lcov, to get your coverage data. Once you interact with the app, either manually or through automated tests, the coverage data gets written.

However, with Xcode7, looks like the coverage data is limited to only Xcode unit tests. I am still trying to figure out, if there is any way to gather the coverage data, by interacting with the application manually, or through automated tests.

Please let me know if you find something useful.

Xcode 5.1 Changes

I'm having some issues running ./getcov after switching to Xcode 5.1 (I've replaced any calls to my app name with [App] and its test suite to [AppTests]):

Ellens-MacBook-Pro-2:XcodeCoverage ellenshapiro$ ./getcov ~/Library/Developer/Xcode/DerivedData/[App]-gsolxombszraeughodjqqewnlxgd/Build/Products/Debug-iphonesimulator ~/Desktop/[App]/iOS_SDK/Project/XcodeCoverage ~/Desktop/[App]/iOS_SDK/Project/XcodeCoverage Capturing coverage data from /Users/ellenshapiro/Library/Developer/Xcode/DerivedData/[App]-gsolxombszraeughodjqqewnlxgd/Build/Intermediates/[App].build/Debug-iphonesimulator/[AppTests].build/Objects-normal/i386 gcov: Unknown command line argument '-v'. Try: '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/gcov -help' gcov: Did you mean '-a'? gcov: Not enough positional command line arguments specified! Must specify at least 1 positional arguments: See: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/gcov -help geninfo: Use of uninitialized value $version_string in pattern match (m//) at /Users/ellenshapiro/Desktop/[App]/iOS_SDK/Project/XcodeCoverage/lcov-1.10/bin/geninfo line 1874. geninfo: Use of uninitialized value $gcov_version_string in pattern match (m//) at /Users/ellenshapiro/Desktop/[App]/iOS_SDK/Project/XcodeCoverage/lcov-1.10/bin/geninfo line 3622. geninfo: Use of uninitialized value $gcov_version_string in pattern match (m//) at /Users/ellenshapiro/Desktop/[App]/iOS_SDK/Project/XcodeCoverage/lcov-1.10/bin/geninfo line 3622. Scanning /Users/ellenshapiro/Library/Developer/Xcode/DerivedData/[App]-gsolxombszraeughodjqqewnlxgd/Build/Intermediates/[App].build/Debug-iphonesimulator/[AppTests].build/Objects-normal/i386 for .da files ... geninfo: ERROR: no .da files found in /Users/ellenshapiro/Library/Developer/Xcode/DerivedData/[App]-gsolxombszraeughodjqqewnlxgd/Build/Intermediates/[App].build/Debug-iphonesimulator/[AppTests].build/Objects-normal/i386! Reading tracefile Coverage.info lcov: ERROR: no valid records found in tracefile Coverage.info Reading tracefile Coverage.info lcov: ERROR: no valid records found in tracefile Coverage.info Reading data file Coverage.info genhtml: ERROR: no valid records found in tracefile Coverage.info The file /Users/ellenshapiro/Library/Developer/Xcode/DerivedData/[App]-gsolxombszraeughodjqqewnlxgd/Build/Products/Debug-iphonesimulator/lcov/index.html does not exist.
I was able to find this Stack Overflow post, which appears to have some information like that -v is now deprecated, but it seems from that post like Xcode 5.1 has opened up a rather large can of worms with this change.

Any thoughts on how to make this script play nice with Xcode 5.1?

Cobertura-formatted XML reports?

First off - I just ran through your setup and have to say that this is phenomenal. By far, the most easiest and quickest setup for measuring code coverage of iOS projects. I was nervous when I found an outdated blog post referencing this project, but then when I came to GitHub and saw you are actively maintaining it, I was pumped. Thank you

How can I modify this script to generate an XML report that may be consumed by Cobertura in order to better display the coverage stats in Jenkins?

Using XcodeCoverage with sandboxed Mac Apps

I'd like to generate coverage report for a sandboxed OS X file. This is a little tricky, because the running application cannot write covering coverage data to it's build directory.

I followed the instructions at https://developer.apple.com/library/ios/qa/qa1514/_index.html for sandboxed applications.
The .gcda files are now located in the sandboxed application's Document directory within its sandbox container. e.g. ~/Library/Containers/<bundle_id>/Data/Documents/Build/Intermediates//........

The .o file and .gcno files are somewhere in Xcode's derived data directory. Any ideas how to handle this situation?

envcov.sh: line 7: env.sh: No such file or directory

Hi, I have downloaded your project and try it.
But the first time I try to run the ./getcov there is this error "envcov.sh: line 7: env.sh: No such file or directory".
I hope you could help me.
Thanks in advance.

Functions coverage no longer measured

While source/line coverage is still measured, functions coverage is not. The resultant report shows 0/0 functions coverage for every source file.

Is XcodeCoverage going to be updated to work with the LLVM-COV profdata file?

Since SDK 9 I am unable to use XcodeCoverage.

I cannot turn on INSTRUMENT_PROGRAM_FLOW to generate the GCOV files, as it causes my test run to fail. Lots of "cannot merge previous GCDA file: corrupt arc tag" entries in the console, and it then crashes in main.m showing BAD_ACCESS on the line calling UIApplicationMain.

I cannot turn INSTRUMENT_PROGRAM_FLOW on for the main target, but without it, I cannot generate GCDA files.

Is there a way to fix this, or do we need to wait till XcodeCoverage supports LLVM-COV profdata?

how to deal with the follow problem

lcov: ERROR: no valid records found in tracefile Coverage.info
Reading tracefile Coverage.info
lcov: ERROR: no valid records found in tracefile Coverage.info
Reading tracefile Coverage.info
lcov: ERROR: no valid records found in tracefile Coverage.info
Reading tracefile Coverage.info
lcov: ERROR: no valid records found in tracefile Coverage.info
Reading tracefile Coverage.info
lcov: ERROR: no valid records found in tracefile Coverage.info
Reading data file Coverage.info
genhtml: ERROR: no valid records found in tracefile Coverage.info

Swift support with xcode 9.4

HI Jon,

Background : We are using your XcodeCoverage report to generate html reports for our project which has a mix of ObjC and Swift Classes. ObjC works perfectly but XcodeCoverage report misses coverage for all the Swift files.

I saw your comment about no support for Swift here. Any Plans for doing it in future? Can you please add support for Swift files coverage.

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.