Closed GoogleCodeExporter closed 8 years ago
Update: I found an explanation why it is always 0%. It was just in front of my
eyes, as Coverstory was yelling me at: there are no .gcda files produced. I
have only .gcno files. I have no clue why, my GCC setup is correct:
-fprofile-arcs is setup, or in Xcode words: GCC_INSTRUMENT_PROGRAM_FLOW_ARCS =
YES
Original comment by cedric.f...@gmail.com
on 31 Dec 2010 at 1:47
So my guess is the 4.x Simulator adds the sandbox for the gcda files aren't
getting written back. We'll try to confirm things, but it may mean coverage on
the simulator is dead until something else can be figured out.
Original comment by thoma...@gmail.com
on 31 Dec 2010 at 5:17
Is -ftest-coverage setup and are you linking to the gcov library? I'm getting
gcda files here running in the simulator.
Original comment by dmaclach
on 3 Jan 2011 at 9:06
It's working fine here with a couple of fun things to be aware of (this is with
XCode 3.2.5 building against the iOS 4.2 SDK running in Simulator with gcc 4.2)
a) It appears they have fixed the gcov linking issues documented here:
http://code.google.com/p/google-toolbox-for-mac/wiki/SnowLeopardGCov although
the prefix header issues still appear to exist
b) You need to make sure that your app quits properly for gcda files to be
written out.
So, be sure to turn off prefix header generation. Then either:
a) Always quit the simulator by going to the simulator and choosing "quit" from
the menu as opposed to hitting stop in xcode.
b) or add
<key>UIApplicationExitsOnSuspend</key>
<true/>
to your plist.
Please let me know if this helps. If I don't hear back from you in a couple of
days, I'm going to close this issue as "WontFix". I will update the gcov wiki
information.
Original comment by dmaclach
on 3 Jan 2011 at 9:23
Thanks very much for all these informations. Once back to work tomorrow, I'll
check and confirm you that it's also working for me.
Original comment by cedric.f...@gmail.com
on 3 Jan 2011 at 9:35
Wiki updated with new info here:
http://code.google.com/p/google-toolbox-for-mac/wiki/iOSGCov
Original comment by dmaclach
on 3 Jan 2011 at 9:57
I must be wrong somewhere. I now have .gcda files as well as .gcno ones. And
Coverstory gives me non-zero % coverage. But the coverage I see is for test
classes! I obviously expect about 100% of my tests classes to be covered. Note
that I also made sure that my GCC_PREFIX_HEADER entry is blank. I also tested
with the libgcov.a file provided in GTM trunk, but without more success. Sorry,
this might not be related to Coverstory itself.
Original comment by cedric.f...@gmail.com
on 4 Jan 2011 at 8:33
OK, the explanation is simple (a line in the documentation would be nice). To
avoid adding manually all the classes I want to test, my UnitTest target (which
is an app, not a test bundle) had a direct dependency on the main target. In
this case, there are obviously no .gcda and .gcno files produced for the main
target's classes. So to have coverage, I need to removed the direct dependency,
and add the main target's classes, and now I have coverage.
Original comment by cedric.f...@gmail.com
on 4 Jan 2011 at 9:51
Glad you got it working.
Original comment by dmaclach
on 4 Jan 2011 at 4:13
Original issue reported on code.google.com by
cedric.f...@gmail.com
on 31 Dec 2010 at 11:03