totocaster
totocaster

Reputation: 6363

Testing own OS X framework

I'm writing my first OS X Objective-C framework, but I do not know how to test it. How can I execute methods and classes in framework for testing purposes?

Upvotes: 1

Views: 295

Answers (4)

Barry Wark
Barry Wark

Reputation: 107754

Chris Hanson's excellent set of articles on setting up unit testing for Frameworks in Xcode is a wonderful reference for testing frameworks. Their content has been largely incorporated (and supplanted) by the article, Automated Unit Testing with Xcode 3 and Objective-C, on Apples' Dev site.

Upvotes: 5

mouviciel
mouviciel

Reputation: 67831

You can find several articles about unit testing on the blog of Chris Hanson.

Upvotes: 1

Peter Hosey
Peter Hosey

Reputation: 96323

Make a unit test bundle target, and create test case classes in that bundle. You'll link against the OCUnit framework to get the base classes for your tests; there are a few OCUnit tutorials around, which you can find on Google.

For harder-to-test tasks, such as drawing in views, the easiest way is to make a test app and check the results yourself.

Upvotes: 2

cobbal
cobbal

Reputation: 70703

One possibility would be to create a new executable target that depends on and calls the framework you're using.

Upvotes: 0

Related Questions