• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Xcode 4 and unit tests
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode 4 and unit tests


  • Subject: Re: Xcode 4 and unit tests
  • From: "Reaves, Timothy" <email@hidden>
  • Date: Tue, 05 Apr 2011 09:06:12 -0400

Getting this all working is frustrating, but is do-able.  It is a shame that Apple has decided to pay unit testing such short-shrift.  Xcode 4 could be such an awesome platform for running these unit tests, and Xcode 4 has made improvements, the biggest is that it will annotate the code when a test fails.

Anyway.

The biggest issues I had were mainly my fault. Insure that all of your code that needs to be is marked for inclusion in both your app target and the test target.  This can be done by looking at the compilation steps for the two targets, or on a per-file bases by using that inspector that resides on the far right.  You need to also insure your data model is included in the test target too, and that the framework is included in the 'link' step of the tests build.




On Fri, Apr 1, 2011 at 6:39 PM, Luther Baker <email@hidden> wrote:
Speaking of unit testing - I created a unit test that involved Core Data and the test couldn't find the data model.

Is that because the test is driven script that doesn't necessary know about an "NSBundle" ... or is there some other obvious mistake I made?

Thanks,
-Luther


On Fri, Apr 1, 2011 at 5:15 PM, Paul Summermatter <email@hidden> wrote:
Mike,

       We haven't taken the plunge yet to Xcode 4, but I can say that Xcode has not had good support for unit testing, and it's been more than a little frustrating.  I'm used to IDEA where everything just works without much effort.  That being said, others on this list recommended using GHUnit, and we followed their advice and are much happier for it:

http://gabriel.github.com/gh-unit/

       It's been a while since we made the switch, and I don't remember all the details of what we had to do, but I seem to recall it was relatively straightforward to set up.

Regards,
Paul

On Apr 1, 2011, at 2:21 PM, McLaughlin, Michael P. wrote:

> I delayed  installing Xcode 4 until it was released.  I now have Xcode 4.0.1
> installed in parallel to Xcode 3.2.6.
>
> I am not very familiar with Xcode 4 nor with the unit testing mechanism it
> uses.  Therefore, I set forth to remedy the latter situation.
>
> Hoping that it would “just work”, I created a new (non-document) Cocoa app
> project with unit tests enabled and Git disabled.  Building for running
> worked well and the app ran as expected.
>
> Building for testing failed with the error
>
> SenTestingKit/SenTestingKit.h file not found
>
> I saw that the SenTestingKit framework was not in the project but that its
> header path was specified in the Build options.  Just to be sure, I added
> this framework to the Other Frameworks group in the project.  The build for
> testing still failed even when I added this framework to both targets.
>
> Nothing in the User Guide prepared me for this.  Am I missing something
> obvious?
>
> Thanks.
>
> --
> Mike McLaughlin
>
> _______________________________________________
> 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


 _______________________________________________
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

References: 
 >Xcode 4 and unit tests (From: "McLaughlin, Michael P." <email@hidden>)
 >Re: Xcode 4 and unit tests (From: Paul Summermatter <email@hidden>)
 >Re: Xcode 4 and unit tests (From: Luther Baker <email@hidden>)

  • Prev by Date: Re: XCode 4 crash on project open
  • Next by Date: Re: Xcode doesn't show you why it stopped anymore?
  • Previous by thread: Re: Xcode 4 and unit tests
  • Next by thread: Re: Xcode 4 and unit tests
  • Index(es):
    • Date
    • Thread