Re: Code Coverage with iOS apps
Re: Code Coverage with iOS apps
- Subject: Re: Code Coverage with iOS apps
- From: Aaron Montgomery <email@hidden>
- Date: Wed, 09 Jan 2013 15:18:24 -0800
Haven't tried it in 4.5, but in earlier versions of Xcode 4, it was working for me. I'm assuming you are getting gcno files since you don't mention that they are missing, so the compiler settings are probably correct. The gcda files will be generated in the same directory as the gcno files. Since they are generated when the app terminates, you need to get the app to terminate (not just go into the background). You may need to quit the simulator (not quit the app in the simulator, but quit the simulator application) in order to make this happen.
Aaron
On Jan 9, 2013, at 10:36 AM, Paul Summermatter <email@hidden> wrote:
> Folks,
>
> I'm trying to figure out what the current state of the art is with respect to code coverage in Xcode. I've been bouncing all over the place with Google searches, finding some recent information and other information that is likely out of date. The information seems to be split between whether you are running GCC or LLVM. I am running Xcode 4.5.1 with LLVM. Based on some information I have found, it seems like getting coverage information with LLVM should be as simple as turning on two flags in your target: "Instrument Program Flow" and "Generate Test Coverage Files". I have both of these set to Yes for a GHUnit target that I have, but, when I build and run my unit tests, I never see any gcov or gdca files anywhere in the build directory (these are unit tests for an iOS app that runs in the simulator). I'm right clicking on the product in Xcode and choosing Reveal in Finder and then navigating up the path to the Build dir. I'm then dragging that into terminal and doing a cd. I then execute various variants of the following:
>
> find . -name "*gcda*" -print
>
> I've tested to make sure I find files such as *dSYM, but no gcda or gcov files seem to be created anywhere in the Build directory. I'm not sure how/if I can troubleshoot this further.
>
> I've seen a lot of other posts out there about coverage working or not working for people in various versions of Xcode, and I'm getting lost in something that I would have hoped would be a lot easier. In IDEA, I click one button and this is done right in the IDE without any special effort on my part. Is this possible yet in Xcode or do I need to dig in and prepare for a much tougher slog here? If there is official Apple documentation somewhere on how to do this, I haven't found it yet, but if anyone can please direct me, I will gladly go RTFM.
>
> Regards,
> Paul
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Xcode-users mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden