Do OCUnit and OCMock work on the iPhone SDK? - iphone

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!

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

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

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.

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.

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.

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

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

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

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

Related

Compile XCode Projects online

I'm using the mosync library for develop iPhone applications. It generates the Xcode project ,
now I need to compile it to make it run on a iphone. So for that I need a mac.
do anybody know somewhere online to find online compiler which do that with a web based interface?
--thanks in advance--
Its really a difficult ask, since apples terms of use on certificates stop people from doing this.
But I got a paid solution for the same problem you mentioned which provides Xcode on Macintosh with latest updates. It just cost about 10$-20$ per month. Initially, you will get the trial offer too. If you like it, then you can subscribe it.
But friends beware of those who provides hacintosh version.
You can refer to following link-
http://www.xcodeclub.com/
http://virtualmacosx.com/
If you want to compile C or C++ right on iPhone/iPad you can try CppCode ios app

Functional testing automation tools for iPad/iPhone?

There doesn't seem to be many choices out there for running functional tests on the iPad/iPhone. A quick search brought up a few options: FoneMonkey, Frank, UI Automation.
Does anyone have experience with any of these or have suggestions for better solutions?
I'm the FoneMonkey project founder, so admittedly a bit biased, but I would strongly recommend you give FoneMonkey a try. It provides robust recording and playback for native iPhone and iPad apps, and you can easily extend custom scripts with Objective-C logic to automate virtually any UI scenario.
The next release (due out later this week) generates UIAutomation-based tests in JavaScript, as well as ready-to-run OCunit tests.
Stu Stern
I also found these:
UISpec: http://code.google.com/p/uispec/
Squish: http://www.froglogic.com/products/editions.php
Are there some more?
This is another tool that could be used for UI testing.
Debugging with console environment.
libcat : interactive iPhone application development
https://github.com/wookay/libcat
There is also one more app in app store. Name of app is TestStudio from Telerik. (http://www.telerik.com/)
It is good but you require Mac Book to install their extension where you can register your app and then use that app on iPad to test.
Hope this will help.

Using MacRuby to Test iPhone Application?

I have an existing iPhone app, written in Objective-C, that I'd like to add some automated tests to. I've read this article about testing with MacRuby, which sounds great but it's aimed at testing desktop frameworks.
How can I add MacRuby tests to my iPhone app? The Ruby code doesn't recognize my Objective-C classes, and I don't know how to set it up to do that. Do I need to somehow point it at the compiled code or the headers?
rbiphonetest worked for me back in the iPhone OS 2 and 3.x days with regular ruby. It was fairly limited though. I haven't tried it with 4.x or macruby specifically.
MacRuby doesn't run on iOS, nor do I see that happening any time soon. I have been working on a port of Bacon (a Ruby rspec clone) to the Nu language: https://github.com/alloy/NuBacon. I still have to do some cleaning and write a blog post about it, I'll see if I can spare some time today to do so.

DragonFireSDK and iPhone development on Windows

So in previous questions about iPhone development on Windows, the basic/easy answer has been "just get a mac." However, I noticed a comment that mentioned DragonFireSDK. But no one else said anything about it?
Has anyone tried this? It look pretty legit to me, but I'm new to the iPhone world. I just find it weird that no one has discussed this yet. I mean, it looks like the perfect tools for the Windows users.
Thanks!
Oh yeah....here's the link to DragonFireSDK: DragonFireSDK
EDIT: This app is for my website, We, the Pixels. Any comments on if Dragonfire would be a good fit for an iPhone version of my website? Thanks!
DragonFireSDK is good, I have been developing several apps with it, the first of which is now available, a game called Firefox Fun: http://itunes.apple.com/us/app/firefox-fun/id393933733?mt=8
Yes, I use DFSDK and got my apps published to apples appstore using the sdk. they have good API it lets you use c/c++ to create your app.

Unit and Functional testing iPhone code?

I just sat in on a seminar about developing apps for the iPhone. The speaker told me that there is NOTHING available for writing unit tests or functional tests for your iPhone software.
Is this true? Is there really no testing story for the iPhone as of now?
Yes you can do unit testing, I hope the seminar didn't cost too much.
Do OCUnit and OCMock work on the iPhone SDK?
Not true. Before SDK 2.2 there wasn't an official Apple sanctionned unit testing support, but they've since added OCUnit support, which is documented on the Apple website.
Do OCUnit and OCMock work on the iPhone SDK?
Google provides a great toolkit (Google Toolbox for Mac)
http://code.google.com/p/google-toolbox-for-mac/wiki/iPhoneUnitTesting
I think Google's is a bit more complete because you can also do some functionnal user interface tests.
Hope that helps.
Others have pointed out the available options, but I'll point out that even if there weren't any unit-testing frameworks available, there is nothing preventing you from rolling your own. Unit test frameworks aren't that complicated, so lack of one is no excuse.
No, this is not true. As of iPhone SDK 2.2, OCUnit works fine. In addition there are other open-source unit test libraries you can use with the iPhone.
http://developer.apple.com/tools/unittest.html
Sen:te (the creator of the testing framework included with Xcode) explains how to use OCUnit with an iPhone project: http://www.sente.ch/s/?p=535&lang=en.
Gorilla Logic has just open sourced FoneMonkey, a true record/playback functional testing tool for the iPhone that works with OCUnit.
You can learn more at http://www.gorillalogic.com/fonemonkey.