Skip to content

Commit

Permalink
Remove conditional Xcode version support. (#475)
Browse files Browse the repository at this point in the history
These were so long ago, no one should really be using them.
  • Loading branch information
thomasvl authored Oct 1, 2024
1 parent 27c68c5 commit b83f1b8
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions UnitTesting/GTMGoogleTestRunner.mm
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,6 @@ @interface GTMGoogleTestRunner : XCTestCase {
NSString *testName_;
}

// We need Xcode 11.4 or better to support test skipping.
#define IS_XCODE_11_4_OR_BETTER \
(__IPHONE_OS_VERSION_MAX_ALLOWED >= 130400 || \
__MAC_OS_X_VERSION_MAX_ALLOWED >= 101504)

// We need Xcode 11.4 or better to support XCTIssue.
#define IS_XCODE_12_0_OR_BETTER \
(__IPHONE_OS_VERSION_MAX_ALLOWED >= 130700 || \
__MAC_OS_X_VERSION_MAX_ALLOWED >= 101504)

#if IS_XCODE_11_4_OR_BETTER

// If a test has been skipped this will be set with an exception describing
// the skipped test.
@property(nonatomic) _XCTSkipFailureException *skipException;
#endif

// The name for a test is the GoogleTest name which is "TestCase.Test"
- (instancetype)initWithName:(NSString *)testName;
@end
Expand Down Expand Up @@ -137,7 +120,6 @@ virtual void OnTestPartResult(const TestPartResult &test_part_result) {
NSString *oneLineSummary =
[summary stringByReplacingOccurrencesOfString:@"\n" withString:@" "];
BOOL expected = test_part_result.nonfatally_failed();
#if IS_XCODE_11_4_OR_BETTER
XCTSourceCodeLocation *location =
[[XCTSourceCodeLocation alloc] initWithFilePath:file lineNumber:line];
XCTSourceCodeContext *codeContext =
Expand All @@ -161,9 +143,7 @@ virtual void OnTestPartResult(const TestPartResult &test_part_result) {
initWithName:@"_XCTSkipFailureException"
reason:@"Test skipped"
userInfo:userInfo];
return;
} else {
#if IS_XCODE_12_0_OR_BETTER
XCTIssue *issue = [[XCTIssue alloc]
initWithType:expected ? XCTIssueTypeAssertionFailure
: XCTIssueTypeUncaughtException
Expand All @@ -173,16 +153,7 @@ virtual void OnTestPartResult(const TestPartResult &test_part_result) {
associatedError:nil
attachments:@[]];
[test_case_ recordIssue:issue];
return;
#endif // IS_XCODE_12_0_OR_BETTER
}

#else // IS_XCODE_11_4_OR_BETTER
[test_case_ recordFailureWithDescription:oneLineSummary
inFile:file
atLine:line
expected:expected];
#endif
}

private:
Expand Down

0 comments on commit b83f1b8

Please sign in to comment.