Re: OCUnit vs OBJCUnit
Re: OCUnit vs OBJCUnit
- Subject: Re: OCUnit vs OBJCUnit
- From: James Quick <email@hidden>
- Date: Wed, 25 Jun 2003 19:36:19 -0400
On Wednesday, June 25, 2003, at 06:42 PM, Jiva DeVoe wrote:
Both frameworks deliver that level of integration. Specifically
however I was referring to how I always disliked that OCUnit required
an external script to run the test application. Or a least it did
when I used it. There are some good reasons to do this, in particular
when writing test frameworks for things like C++, which doesn't have
reflection capabilities.
Hmmm. I had not looked deeply enough into where/when AllTests was
called.
I see now where TestRunnerMain([AllTests class]);
is called in the main function for OBJCUnit.
I actually don't see this problem.
By default OCUnit runs an external utility, otest, which probes the
bundle/excecutable/framework
for all the testing code, then runs all the tests. Looking at the
code, I see a function
SenSelfTestMain(), whose comment says you can call from your main
function.
There all also some methods in SenTestProbe
+ (BOOL) isLoadedFromApplication
and
+ (BOOL) isLoadedFromTool
So it would appear that you can embed your tests internally and omit
the external otool run.
What I do like is the way both otest and SenSelfTestMain(), rely on
name and signature
to identify and gather tests automatically. It seems like a pain to
have to manually add
all of your tests to Alltests.m each time you add a new suite of tests.
OCUnit simply
walks through the classes and methods to find every relevant test.
You can through arguments, defaults, and Build variables tell it to
find and run only a subset
of tests if you like.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.