Hi all,
I am using Xcode 3.1 and plan to add a dependent Unit
Test Bundle into our project to do the UT.
Because we are developing a PDE, so we use
OutputBinsPDE for experiment.
I follow apple’s “Xcode Unit Testing Guide”
1. Add a Cocoa Unit Test Bundle target.
2. Add Direct Dependency to OutputBinsPDE
3. Assign the value $(BUILT_PRODUCTS_DIR)/$(PROJECT_NAME).bundle/Contents/MacOS/$(PROJECT_NAME)
to the Bundle Loader setting.
4. Add a testable class into OutputBinsPDE: Testable.h,
Testable.m with the follow function:
-
(NSUInteger)add4:(NSUInteger)value {
return
value+4;
}
5. Add a testcase class into the Unit Test Bundle:
TestCases.h, TestCases.m with the follow functions:
-
(void)setUp {
[super
setUp];
testable
= [[Testable alloc] init];
}
- (void)tearDown
{
[testable
release];
[super
teardown];
}
- (void)testAdd
{
STAssertEquals([testable
add4:5], (NSUInteger)9, @”should add 4!”);
}
6. Then I build the UT bundle.
First Xcode builds the OutputBinsPDE and success;
Then Xcode builds the Unit Test Bundle, it crashes
when “Running custom shell script” with error “Test rig ‘/Developer/Tools/otest’
exited abnormally with code 138 (it may have crashed)”
If I add the Unit Test bundle into an Application
project, everything is OK.
Can someone shed light on why the error happens?
Thanks in advance.
Kevin