Step-by-step guide

159 views
Skip to first unread message

Nathan

unread,
Feb 10, 2010, 10:20:23 PM2/10/10
to coverstory-discuss
Is there a step-by-step guide on setting up your project to use cover
story? I've been trying off and on and usually get tired and
frustrated with it. The errors are so cryptic. Getting undefined
symbols errors and the shell script is failing.

A step by step example guide would be nice.

Thanks for any help.

Dave MacLachlan

unread,
Feb 10, 2010, 11:38:42 PM2/10/10
to coverstor...@googlegroups.com

Can you give us the build output that you are seeing? That'll help me
put together a guide and it will be sure to address your pain points.

Cheers,
Dave

Pat McGee

unread,
Feb 10, 2010, 11:39:51 PM2/10/10
to coverstor...@googlegroups.com
Here's what I did. It worked for me under Xcode 3.1.2:

Create a new configuration by copying the Debug configuration. (Do
"get info" on project; select "Configurations" tab.) Name it
"Coverage". In that configuration, change the following build settings:
Add "-lgcov" to "Other Linker Flags"
Turn on "Instrument Program Flow"
Turn on "Generate Test Coverage Files"
Clean all targets, build, go. Make sure you only run the specific
tests you want coverage of.

Presumably the last step was to start CoverStory and navigate to
the .gcda files, but I didn't write notes for that. Presumably that
means it just worked.

If that doesn't work for you, please let me know.

Pat

> --
> You received this message because you are subscribed to the Google
> Groups "coverstory-discuss" group.
> To post to this group, send email to coverstor...@googlegroups.com
> .
> To unsubscribe from this group, send email to coverstory-disc...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/coverstory-discuss?hl=en
> .
>

--
"Save the Earth; it's the only planet with chocolate!"

Pat McGee, j...@XorAndOr.com


Nathan

unread,
Feb 10, 2010, 11:52:42 PM2/10/10
to coverstory-discuss
Hey guys, thanks for the rapid reply (surprised me).

Again, I have been trying to use cover story on an off. But looks
like I finally made a break through.

Although I'm using Snow Leopard, I used these instructions:
http://code.google.com/p/google-toolbox-for-mac/wiki/TigerGcov

In the other linker flags, I fully qualified the libgcov.a file
(/Volumes/Data/Projects\ and\ Source\ Code/google-toolbox-for-mac/
TigerGcov/libgcov.a)


My target compiles and some files are being generated. However, one
issue. I'm not seeing and *.gcda files. Now, the site
www.realdevelopers.com/blog/?p=456 , step 3 says to clear the
environment variable….but I don't know how to do that.

Second…the other issue is…I trying to do code coverage on a static
library. My project has a target that's a static library and a target
that does unit tests on that library. I need to measure the code
coverage on the static library and not the unit test.

This is a lot further than I was a while back. So I guess I need to
keep plowing ahead. Any help would be necessary.

Nathan

unread,
Feb 10, 2010, 11:53:01 PM2/10/10
to coverstory-discuss
Hey guys, thanks for the rapid reply (surprised me).

Again, I have been trying to use cover story on an off. But looks
like I finally made a break through.

Although I'm using Snow Leopard, I used these instructions:
http://code.google.com/p/google-toolbox-for-mac/wiki/TigerGcov

In the other linker flags, I fully qualified the libgcov.a file
(/Volumes/Data/Projects\ and\ Source\ Code/google-toolbox-for-mac/
TigerGcov/libgcov.a)


My target compiles and some files are being generated. However, one
issue. I'm not seeing and *.gcda files. Now, the site
www.realdevelopers.com/blog/?p=456 , step 3 says to clear the
environment variable….but I don't know how to do that.

Second…the other issue is…I trying to do code coverage on a static
library. My project has a target that's a static library and a target
that does unit tests on that library. I need to measure the code
coverage on the static library and not the unit test.

This is a lot further than I was a while back. So I guess I need to
keep plowing ahead. Any help would be necessary.

> > For more options, visit this group athttp://groups.google.com/group/coverstory-discuss?hl=en

Nathan

unread,
Feb 11, 2010, 12:08:05 AM2/11/10
to coverstory-discuss
Oh, also, I'm getting 'Version mismatch - expected 400A got 402*"

I guess I'm using the wrong versions and need to do some downloading.
What a mess.

On Feb 10, 10:53 pm, Nathan <natha...@gmail.com> wrote:
> Hey guys, thanks for the rapid reply (surprised me).
>
> Again, I have been trying to use cover story on an off.  But looks
> like I finally made a break through.
>
> Although I'm using Snow Leopard, I used these instructions:http://code.google.com/p/google-toolbox-for-mac/wiki/TigerGcov
>
> In the other linker flags, I fully qualified the libgcov.a file
> (/Volumes/Data/Projects\ and\ Source\ Code/google-toolbox-for-mac/
> TigerGcov/libgcov.a)
>
> My target compiles and some files are being generated.  However, one

> issue.  I'm not seeing and *.gcda files.  Now, the sitewww.realdevelopers.com/blog/?p=456, step 3 says to clear the

Pat McGee

unread,
Feb 11, 2010, 12:09:30 AM2/11/10
to coverstor...@googlegroups.com

On Feb 10, 2010, at 11:53 PM, Nathan wrote:

> My target compiles and some files are being generated. However, one
> issue. I'm not seeing and *.gcda files.

Do you run (not just build) your code first? I think these are the
files that contain the counts of lines executed.


Pat

Nathan

unread,
Feb 11, 2010, 12:22:35 AM2/11/10
to coverstor...@googlegroups.com
I was just doing builds


Pat

Pat McGee, j...@XorAndOr.com


Dave MacLachlan

unread,
Feb 11, 2010, 12:32:30 AM2/11/10
to coverstor...@googlegroups.com
You definitely need to run your code to get coverage numbers.

You may also want to look at the GTM Xcode plugin (Available here)

http://code.google.com/p/google-toolbox-for-mac/downloads/list

That allows you to turn on Code Coverage, clean code coverage and
other exciting things.

Installation docs here:

http://code.google.com/p/google-toolbox-for-mac/wiki/GTMXcodePlugin

Cheers,
Dave

Dave MacLachlan

unread,
Feb 11, 2010, 12:33:27 AM2/11/10
to coverstor...@googlegroups.com
We haven't done a lot of testing on Snow Leopard yet. Due to some
networking issues with SL on our internal network we're not using it
heavily here at Google yet. I'll take a look and see how it's working
tomorrow AM (PST).

Cheers,
Dave

Nathan

unread,
Feb 11, 2010, 12:38:32 AM2/11/10
to coverstor...@googlegroups.com
Dude....let me fight through it some more. I got further than I was a few
weeks ago. I'll keep you updated. Do not go out of you way.

I appreciate the rapid responses.

-----Original Message-----
From: coverstor...@googlegroups.com
[mailto:coverstor...@googlegroups.com] On Behalf Of Dave MacLachlan
Sent: Wednesday, February 10, 2010 11:33 PM
To: coverstor...@googlegroups.com

Cheers,
Dave

>> environment variable..but I don't know how to do that.
>>
>> Second.the other issue is.I trying to do code coverage on a static

Thomas Van Lenten

unread,
Feb 11, 2010, 8:25:10 AM2/11/10
to coverstor...@googlegroups.com
The version mismatch is from gcc4.2 vs. gcc4.0, a matching versiom of gcov needs to be run.  I'm not a code at the moment, but I thought I snuck in a hidden defaults for coverstory to change to the path to the gcov we use.   Setting that default to point to the 4.2 gcov might fix things.  Here's the issue, http://code.google.com/p/coverstory/issues/detail?id=20

TVL

Nathan

unread,
Feb 11, 2010, 8:48:14 AM2/11/10
to coverstor...@googlegroups.com
Thanks for the quick response.
 
Where do I change that setting?  Or how do I "find" the 4.2 gcov?

Thomas Van Lenten

unread,
Feb 11, 2010, 4:36:08 PM2/11/10
to coverstor...@googlegroups.com
Looks like I didn't make it a default.  CoverStoryDocument.m has the quick checks for /usr/bin/gcov vs. /Developer/usr/bin/gcov, try changing those to be gcov-4.2 (or gcov-4.0) and see if that makes things happier on Snow Leopard.

TVL

Nathan

unread,
Feb 11, 2010, 7:32:51 PM2/11/10
to coverstor...@googlegroups.com
Ok...I guessing I have to download the project/source code and make the change and do a build.  I'll keep you informed.
 
Thanks for the help and interest so far, I really appreciate it.

Reply all
Reply to author
Forward
0 new messages