Do OCUnit and OCMock work on the iPhone SDK?
Asked Answered
O

9

19

I simply could not make it work, and I am wondering if I am wasting my time, or if I am simply stupid!

Sorry I don't have the exact error I have right now. But I just want to know if it work or not!

Orfinger answered 1/10, 2008 at 19:22 Comment(0)
V
17

I don't know whether OCUnit works with iPhone, but there is an iPhoneUnitTesting framework available from Google Code.

Vanderpool answered 1/10, 2008 at 19:22 Comment(1)
The Google Toolbox for Mac is a great piece of software. I have found it to be a must have for iPhone development.Shawnna
M
9

Colin Barrett has a blog post about OCMock and the iPhone.

Maurizia answered 14/12, 2008 at 19:1 Comment(0)
C
7

Not so sure about OCMock, but OCUnit support is now included in iPhone 2.2 SDK.

You can download an example application from Stanford iPhone Application Programming CS193P Lecture 19.

Cacomistle answered 14/12, 2008 at 16:43 Comment(1)
The contents of that page was probably updated, there is no Lecture 19 to be found there now.Handgrip
I
5

Sen:te (the creator of the framework) explains how to use OCUnit with an iPhone project: http://www.sente.ch/s/?p=535&lang=en.

Irons answered 18/1, 2009 at 15:30 Comment(0)
G
4

I created some OCUnit tests for an iPhone app, but in order to run the tests I had to compile for Mac OS X, not iPhone OS, and switching back and forth was a pain.

The Google framework is cleaner, they can run the tests in the simulator or on the device.

Gladstone answered 3/10, 2008 at 19:31 Comment(0)
H
4

I got hung up on the same thing. I finally found the answer on Mitch's World then reposted the solution on my site. The quick fix is to add the OCMock.framework folder to /Library/frameworks and reference it from there. For whatever reason XCode doesn't want to add folders external to its natural framework seach to the path. Until I find out more this is the best we can do.

-Cliff

Hollands answered 16/10, 2008 at 14:44 Comment(0)
E
4

At the time of writing OCUnit "just works" on the iPhone. Apple are shipping templates that works out of the box.

Etheleneethelin answered 28/12, 2009 at 23:1 Comment(0)
P
3

Take a look here. You'll find a Xcode template you can use that has OCUnit and OCMock all ready setup for you.

Pompidou answered 5/12, 2009 at 17:31 Comment(0)
H
1

You might be interested in this project which integrats OCMock & gh-unit (based on Google toolkit)

Unit test

Hiss answered 29/12, 2009 at 14:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.