Doing TDD with OCUnit and XCode

13 views
Skip to first unread message

Eimantas Vaičiūnas

unread,
Sep 25, 2010, 2:48:34 PM9/25/10
to cocoa-...@googlegroups.com
Dear List

I have decided to try out TDD with OCUnit and XCode. Installation and
integration went just fine. I have followed everything to the step in
Apple's developer documentation (adding tests' target and making it
dependent on main framework/app target). Troubles started when I was
trying to build failing test and build magically succeeded! My test
looks like this:

- (void)testTheTruth
{
STAssertTrue(NO, @"Expected true to be false");
}

Here's what I've found while browsing through build result log:

2010-09-25 21:39:02.723 otest[12803:903] Error loading
/Users/eimantas/MacDev/WSEnumerable/build/Debug/Tests.octest/Contents/MacOS/Tests:
dlopen(/Users/eimantas/MacDev/WSEnumerable/build/Debug/Tests.octest/Contents/MacOS/Tests,
265): no suitable image found. Did find:
/Users/eimantas/MacDev/WSEnumerable/build/Debug/Tests.octest/Contents/MacOS/Tests:
mach-o, but wrong architecture

I have tried limiting both targets to be build only under i385 or
x86_64 to no avail. I am looking to any pointers towards the solution.
I have attached full build log for your consideration.

TIA,
// E.

buildlog.txt

Eimantas Vaičiūnas

unread,
Sep 26, 2010, 3:09:12 AM9/26/10
to cocoa-...@googlegroups.com
Dear List,

I have found the problem. I failed to mention that I have installed
the OCUnit testing framework v41 which is outdated so badly, that it's
compiled only for ppc platform. Now I am well aware of the fact that
OCUnit is distributed together with XCode. Replacing otest binary with
the one from up-to-date XCode bundle fixed the issue.

// E.

Reply all
Reply to author
Forward
0 new messages