Reputation: 8626
I try to run GHUnit on the device and receive the following compile error.
ld: warning: directory not found for option '-L/Users/gtaskos/Documents/Projects/My/SDKs/My iOS SDK/My-iOS/Pods/build/Debug-iphoneos'
ld: warning: ignoring file /Users/gtaskos/Documents/Projects/My/SDKs/My iOS SDK/My-iOS/Frameworks/GHUnitIOS.framework/GHUnitIOS, missing required architecture arm64 in file /Users/gtaskos/Documents/Projects/My/SDKs/My iOS SDK/My-iOS/Frameworks/GHUnitIOS.framework/GHUnitIOS (4 slices)
Undefined symbols for architecture arm64:
"_OBJC_METACLASS_$_GHAsyncTestCase", referenced from:
_OBJC_METACLASS_$_MyMintTests in MyMintTests.o
"_OBJC_CLASS_$_GHAsyncTestCase", referenced from:
_OBJC_CLASS_$_MyMintTests in MyMintTests.o
"_OBJC_CLASS_$_GHTesting", referenced from:
objc-class-ref in MyMintTests.o
"_GHComposeString", referenced from:
___38-[MyMintTests testGetDetailsAsync]_block_invoke in MyMintTests.o
___38-[MyMintTests testGetDetailsAsync]_block_invoke38 in MyMintTests.o
-[MyMintTests testStrings] in MyMintTests.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Strange is I tried the https://github.com/gh-unit/gh-unit/tree/master/Examples/MyTestable-iOS
and it works pretty fine.
Some configuration/setup. I have a workspace with a static library project that uses pods for a dependency, in that project I have a OCUnit tests target, a framework aggregate and added an Empty Application target that configured to use GHUnit, added the framework and used the GHUnitIOSAppDelegate
in the main.cs
.
Then I added an Objective-C class with a custom name MyMintGHUnitTests.m which has some methods (although only testStrings is available when I run the target, that is another question for StackOverflow).
- (void) testGetDetailsAsync
{
// Call prepare to setup the asynchronous action.
// This helps in cases where the action is synchronous and the
// action occurs before the wait is actually called.
[self prepare];
[self.utility getDetailsNumWithBlock:^(NSNumber *total)
{
GHTestLog(@"Details Number: %@", total);
GHAssertNotNil(totalCrashes, nil);
[self notify:kGHUnitWaitStatusSuccess forSelector:@selector(getDetailsAsyncTest)];
}
failure:^(NSError *error)
{
GHTestLog(@"Failed to get details: %@", error.description);
GHAssertNil(error, nil);
[self notify:kGHUnitWaitStatusSuccess forSelector:@selector(getDetailsAsyncTest)];
}];
// Wait until notify called for timeout (seconds); If notify is not called with kGHUnitWaitStatusSuccess then
// we will throw an error.
[self waitForStatus:kGHUnitWaitStatusSuccess timeout:5.0];
}
Class inherits from GHAsyncTestCase
.
Maybe I should say that I also use pods for the GHUnit target.
The target runs on Simulator (without my methods) perfect fails on device.
Upvotes: 1
Views: 236