Re: SenTestingKit fails when using CG-Only
Re: SenTestingKit fails when using CG-Only
- Subject: Re: SenTestingKit fails when using CG-Only
- From: Chris Hanson <email@hidden>
- Date: Fri, 9 Nov 2007 18:19:36 -0800
On Nov 9, 2007, at 1:55 PM, Timothy Reaves wrote:
I also had to recompile the framework; otherwise, it'd link and
run, but no tests were executed.
Thanks for letting me know. I know you were one of the people I
provided with the same instructions I gave Andre about this case, but
I haven't yet heard back about whether those instructions worked.
Anyone testing please make sure to file a defect. It's ridicules
to have to jump through these hoops to be able to test. You
wouldn't tolerate compiling your own gcc to support gc.
Please understand that all work is prioritized, and that sometimes the
priorities may not be what you want them to be for a variety of
reasons. You're certainly welcome to disagree with the
prioritization, but remember that you'll attract more flies with honey
than with vinegar; there's no need to be insulting in your disagreement.
Also, please understand that OCUnit as shipped with Xcode 3.0 **does
work** for GC-supported frameworks, and **does work** for both GC-
supported and GC-required applications. It's **only** the case of GC-
required framework tests that OCUnit as shipped with Xcode 3.0 does
not work. Here's the current compatibility matrix as of Xcode 3.0:
test framework test application
GC unsupported works works
GC supported works (non-GC) works (GC)
GC required broken works (GC)
There are already several bugs filed against Xcode about this, so we
don't really need any more; the problem and its solution are both well-
understood. (Obviously I can't say anything more than that about
future products or product plans, so please bear with me.)
I've requested ADC provide the same workaround to others as I gave
Andre earlier in the thread; however, I have not heard back from
anyone about whether it has not worked for them. Your input above is
valuable in that it sounds like the instructions I provided *don't*
work (though they should have).
In the meantime, you should be able to use the following code in a
tool that links against Cocoa and SenTestingKit. Then you should be
able to specify the path to that tool in the OTEST build setting for
your unit test bundle target, and use it to run tests successfully
against GC-required frameworks. Please, anyone who tries it, let me
know if it works for you. (Note: This was typed in Mail, so there may
be typos, but the overall logic should be correct. What's critical is
specifying the right user defaults -- all of which are in
SenTestProbe.h -- and then invoking +[SenTestProbe runTests:].)
-- Chris Hanson
Development Technologies
Apple
#import <Cocoa/Cocoa.h>
#import <SenTestingKit/SenTestingKit.h>
@interface SenTestProbe (InternalMethods)
- (void)runTests:(id)ignored;
@end
int main(int argc, char **argv) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Tell SenTestingKit to use our last argument as the test
bundle, to
// run all the tests it can find, and that the executable is
equivalent
// to the otest test rig supplied with OCUnit.
NSDictionary *testDefaults = [NSDictionary
dictionaryWithObjectsAndKeys:
[[[NSProcessInfo processInfo] arguments] lastObject],
SenTestedUnitPath,
SenTestScopeAll, SenTestScopeKey,
[NSNumber numberWithBool:YES], SenTestToolKey,
nil];
[[NSUserDefaults standardUserDefaults]
registerDefaults:testDefaults];
// Run the tests based on the defaults set above.
// It will invoke exit() with an appropriate value as well.
[SenTestProbe runTests:nil];
[pool drain];
return 0;
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden