Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Update XCTestCase proxy to support Xcode 11.4 #286

Merged
merged 3 commits into from
Feb 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions PrivateHeaders/XCTest/XCTestCase.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
@property(readonly) XCTestContext *testContext;
@property(readonly) unsigned long long activityRecordStackDepth;
@property(nonatomic) BOOL shouldHaltWhenReceivesControl;
@property(nonatomic) BOOL shouldSetShouldHaltWhenReceivesControl; // @synthesize shouldSetShouldHaltWhenReceivesControl=_shouldSetShouldHaltWhenReceivesControl;
@property(retain) XCTestCaseRun *testCaseRun;

+ (id)_baselineDictionary;
Expand Down
11 changes: 10 additions & 1 deletion WebDriverAgentLib/Utilities/FBFailureProofTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,16 @@ - (void)setUp
{
[super setUp];
self.continueAfterFailure = YES;
self.internalImplementation = (_XCTestCaseImplementation *)[FBXCTestCaseImplementationFailureHoldingProxy proxyWithXCTestCaseImplementation:self.internalImplementation];
if ([self respondsToSelector:@selector(internalImplementation)]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about leave a comment Xcode 11.4 no longer have this API in L17 in PrivateHeaders/XCTest/XCTestCase.h ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the codes but the error still exists..... I'm using Xcode 11.4, IOS 11.1. In the WDA file I downloaded, the file FBFailureProofTestCaseTest.m was under path WebDriverAgentTests/IntegrationTests, not WebDriverAgentLib/Utilities. Did I download the wrong file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was WebDriverAgentLib/Utilities/FBFailureProofTestCase.m, not FBFailureProofTestCaseTest.m.
Did you find another issue in FBFailureProofTestCaseTest.m?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. It works fine now. Sorry. That was my stupid mistake. Thanks.

// The `internalImplementation` API has been removed since Xcode 11.4
self.internalImplementation =
(_XCTestCaseImplementation *)[FBXCTestCaseImplementationFailureHoldingProxy
proxyWithXCTestCaseImplementation:self.internalImplementation];
} else {
// https://github.com/appium/appium/issues/13949
self.shouldSetShouldHaltWhenReceivesControl = NO;
self.shouldHaltWhenReceivesControl = NO;
}
}

- (void)recordFailureWithDescription:(NSString *)description
Expand Down