Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SenTestingKit fails when using CG-Only (Fixed)



On 平成 19/11/10, at 11:19, Chris Hanson wrote:
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.

Well, appending to this:

I got it working, just built a new tool from scratch (I don't know why the previous project was passing the framework as the last argument...), but a few caveats.

1) It would still not load the SenTestingKit correctly. Even if I set - rpath manually, it still referenced it from @rpath/ SenTestingKit.framework/Versions/A/SenTestingKit
Putting the framework into one of the framework directories fixed this...... (as a side note, Xcode is installed into my user folder)


2) With the code below, it would not find any tests unless I pre- loaded the bundle of my test, like so: [[NSBundle bundleWithPath: [[[NSProcessInfo processInfo] arguments] lastObject]] load];

3) Since the tool is built with gc turned off, it had to be built with fobjc-gc or higher.

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).
Hope this helps.

And... here is the code:

int main (int argc, const char * argv[]) {
	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

//Making these variables just makes the following easier to read
NSString *lastArgument = [[[NSProcessInfo processInfo] arguments] lastObject];
NSNumber *yesATool = [NSNumber numberWithBool:YES];


// 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: lastArgument, SenTestedUnitPath,
SenTestScopeAll, SenTestScopeKey,
yesATool, SenTestToolKey,
nil];

NSLog(@"Your (Garbage Collected) Test Suite is %@ \n",lastArgument);


	//Register the defaults so the test probe knows what to probe
	[[NSUserDefaults standardUserDefaults] registerDefaults:testDefaults];

	//Load the test bundle beforehand or it wont work...
	[[NSBundle bundleWithPath:lastArgument] load];

	//Probing
	[SenTestProbe runTests:testDefaults];

	[pool drain];
	return 0;
}

Andre

_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.