Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7047619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:47:36+00:00 2026-05-28T02:47:36+00:00

I’m creating an iPhone 5.0 project in Xcode 4.2 and would like to find

  • 0

I’m creating an iPhone 5.0 project in Xcode 4.2 and would like to find the code coverage when the unit tests are executed. I’m quite new to the Xcode environment, and I’ve followed the steps provided here. I’m able to modify the Build Settings for the test target correctly, and link the “libprofile_rt.dylib” file fine.

At this point, when I execute the tests (using Command-U), the code compiles and the tests pass. I do not encounter the problem described here. In addition, I’ve installed CoverStory.

The author in the first link mentions “Just run your unit tests and view the code coverage data as usual”; however, I cannot find .../Objects-normal/i386.

Just to get things working, I created a new project with the following class:

#import "SomeClass.h"

@implementation SomeClass
@synthesize someValue;

-(void)performWork:(BOOL)now withValue:(int)value {
    if (now) {
        someValue = value;
    }
    else {
        someValue = value - 1;
    }
}

@end

and test class:

#import "CodeCoverageTests.h"
#import "SomeClass.h"

@implementation CodeCoverageTests

- (void)testExample {
    SomeClass *obj = [[SomeClass alloc] init];
    [obj performWork:YES withValue:3];
    STAssertEquals(obj.someValue, 3, @"Value was not 3");
}
@end

Ideally, I’d like to be notified in some way that when the tests execute, the else clause in the performWork method is never fired.

I thus have the following questions:

  1. Is the root problem that there’s no support for what I’m trying to do with the new compiler?
  2. Is the only solution the one described by user chown in response to the question I linked above?
  3. Will I be able to use CoverStory (or something similar) if I follow the solution from 2) ?

Update:
After some struggle, I was finally able to find the location of the “SomeClass.gcno” and “SomeClass.gcda” files (thanks @bjhomer – see this link), and they depicted beautifully that the if part of the conditional statement in performWork was covered (and the else was not). To make sure, I modified the test as follows:

- (void)testExample
{
    SomeClass *obj = [[SomeClass alloc] init];
    [obj performWork:NO withValue:3];
    STAssertEquals(obj.someValue, 2, @"Value was not 2");
}

After re-building and re-execution of the unit test, I reloaded the .gcno and .gcda files. CoverStory showed that the coverage changed to the else part of the performWork method. There was one small caveat however:

  1. I needed to modify the build settings of the <TargetName> (not the <TargetNameTest> as shown here) in order for the “SomeClass.gcno” and “SomeClass.gcda” files to be created in ...<TargetName>.build/Objects-normal/i386/ directory.

Thanks again for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:47:37+00:00Added an answer on May 28, 2026 at 2:47 am

    It sounds like your main problem is that you cannot find the Build/Intermediates/<SchemeName>.build/<ConfigurationName>-<PlatformName>/<TargetName>.build/Objects-normal/<ArchitectureName> directory. That directory is always used when building, whether or not you’re doing code coverage. That’s where all the intermediate files generated by the compiler are stored, and is also where the final .gcno and .gcda files should exist if you’re doing code coverage. If you cannot find that directory, the problem is not related to coverage, the problem is that you need to find that directory.

    To answer your questions.

    1. Code coverage is supported in the LLVM Compiler, as of Xcode 4.2. It will not work with LLVM-GCC, so make sure you’re not using that.
    2. No, it is not necessary to hack in support for GCC 4.2 in Xcode 4.2. I’m running code coverage with Xcode 4.2 right now, having done none of the above.
    3. You should be able to use CoverStory either way; hacking in support for GCC 4.2 would not change where the built products go.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.