Skip to content

Commit

Permalink
Fixed test targets to use MacOS 10.15
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyMDev committed Apr 6, 2021
1 parent 13c25f9 commit 0c66480
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 28 deletions.
8 changes: 0 additions & 8 deletions Apollo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,6 @@
90690D142243363D00FC2E54 /* Apollo-Target-TestHost-iOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-TestHost-iOS.xcconfig"; sourceTree = "<group>"; };
90690D2122433C1900FC2E54 /* Apollo-Target-StarWarsAPI.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-StarWarsAPI.xcconfig"; sourceTree = "<group>"; };
90690D2222433C2800FC2E54 /* Apollo-Target-GitHubAPI.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-GitHubAPI.xcconfig"; sourceTree = "<group>"; };
90690D2322433C5900FC2E54 /* Apollo-Target-CacheDependentTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-CacheDependentTests.xcconfig"; sourceTree = "<group>"; };
90690D2422433C8000FC2E54 /* Apollo-Target-PerformanceTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-PerformanceTests.xcconfig"; sourceTree = "<group>"; };
90690D2522433CAF00FC2E54 /* Apollo-Target-TestSupport.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-TestSupport.xcconfig"; sourceTree = "<group>"; };
9B0E4717240AF6D70093BDA7 /* ASTVariableType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ASTVariableType.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -660,7 +659,6 @@
9B7BDA9823FDE94C00ACD198 /* ApolloWebSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApolloWebSocket.swift; sourceTree = "<group>"; };
9B7BDA9923FDE94C00ACD198 /* WebSocketTransport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebSocketTransport.swift; sourceTree = "<group>"; };
9B7BDA9A23FDE94C00ACD198 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9B7BDAA223FDE98B00ACD198 /* ApolloWebSocket-Target-Tests.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ApolloWebSocket-Target-Tests.xcconfig"; sourceTree = "<group>"; };
9B7BDAA323FDE98C00ACD198 /* ApolloWebSocket-Project-Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ApolloWebSocket-Project-Release.xcconfig"; sourceTree = "<group>"; };
9B7BDAA423FDE98C00ACD198 /* ApolloWebSocket-Target-Framework.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ApolloWebSocket-Target-Framework.xcconfig"; sourceTree = "<group>"; };
9B7BDAA523FDE98C00ACD198 /* ApolloWebSocket-Project-Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ApolloWebSocket-Project-Debug.xcconfig"; sourceTree = "<group>"; };
Expand All @@ -671,8 +669,6 @@
9B7BDAD423FDEC9B00ACD198 /* CachePersistenceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CachePersistenceTests.swift; sourceTree = "<group>"; };
9B7BDAD823FDECB300ACD198 /* ApolloSQLite-Target-Framework.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ApolloSQLite-Target-Framework.xcconfig"; sourceTree = "<group>"; };
9B7BDAD923FDECB400ACD198 /* ApolloSQLite-Project-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ApolloSQLite-Project-Debug.xcconfig"; sourceTree = "<group>"; };
9B7BDADA23FDECB400ACD198 /* ApolloSQLite-Target-Tests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ApolloSQLite-Target-Tests.xcconfig"; sourceTree = "<group>"; };
9B7BDADB23FDECB400ACD198 /* ApolloSQLite-Target-TestSupport.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ApolloSQLite-Target-TestSupport.xcconfig"; sourceTree = "<group>"; };
9B7BDADC23FDECB400ACD198 /* ApolloSQLite-Project-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ApolloSQLite-Project-Release.xcconfig"; sourceTree = "<group>"; };
9B7BDAEC23FDED9700ACD198 /* SQLiteTestCacheProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SQLiteTestCacheProvider.swift; sourceTree = "<group>"; };
9B8110A723A1995D00688AC4 /* .keep */ = {isa = PBXFileReference; lastKnownFileType = text; path = .keep; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1016,7 +1012,6 @@
9B7B6F55233C27A000F32205 /* Apollo-Target-ApolloCodegenLib.xcconfig */,
9B68354A2463498D00337AE6 /* Apollo-Target-ApolloCore.xcconfig */,
DEA34AF6260E821F00F95F86 /* Apollo-Target-AnimalKingdomAPI.xcconfig */,
90690D2322433C5900FC2E54 /* Apollo-Target-CacheDependentTests.xcconfig */,
9B4AA8AD239EFDC9003E1300 /* Apollo-Target-CodegenTests.xcconfig */,
90690D06224333DA00FC2E54 /* Apollo-Target-Framework.xcconfig */,
90690D2222433C2800FC2E54 /* Apollo-Target-GitHubAPI.xcconfig */,
Expand All @@ -1030,13 +1025,10 @@
9B7BDAD923FDECB400ACD198 /* ApolloSQLite-Project-Debug.xcconfig */,
9B7BDADC23FDECB400ACD198 /* ApolloSQLite-Project-Release.xcconfig */,
9B7BDAD823FDECB300ACD198 /* ApolloSQLite-Target-Framework.xcconfig */,
9B7BDADA23FDECB400ACD198 /* ApolloSQLite-Target-Tests.xcconfig */,
9B9BBB1624DB74720021C30F /* Apollo-Target-UploadAPI.xcconfig */,
9B7BDADB23FDECB400ACD198 /* ApolloSQLite-Target-TestSupport.xcconfig */,
9B7BDAA523FDE98C00ACD198 /* ApolloWebSocket-Project-Debug.xcconfig */,
9B7BDAA323FDE98C00ACD198 /* ApolloWebSocket-Project-Release.xcconfig */,
9B7BDAA423FDE98C00ACD198 /* ApolloWebSocket-Target-Framework.xcconfig */,
9B7BDAA223FDE98B00ACD198 /* ApolloWebSocket-Target-Tests.xcconfig */,
);
name = Configuration;
path = Configuration/Apollo;
Expand Down

This file was deleted.

3 changes: 3 additions & 0 deletions Configuration/Apollo/Apollo-Target-TestSupport.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ APPLICATION_EXTENSION_API_ONLY = NO
LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*] = $(inherited) $(TOOLCHAIN_DIR)/usr/lib/swift-$(SWIFT_VERSION)/$(PLATFORM_NAME)
FRAMEWORK_SEARCH_PATHS = $(DEVELOPER_FRAMEWORKS_DIR) $(PLATFORM_DIR)/Developer/Library/Frameworks
OTHER_LDFLAGS = -weak_framework XCTest -weak-lswiftXCTest

/// Test Target Deployment Target
MACOSX_DEPLOYMENT_TARGET = 10.15
7 changes: 0 additions & 7 deletions Configuration/Apollo/ApolloSQLite-Target-TestSupport.xcconfig

This file was deleted.

3 changes: 0 additions & 3 deletions Configuration/Apollo/ApolloSQLite-Target-Tests.xcconfig

This file was deleted.

3 changes: 0 additions & 3 deletions Configuration/Apollo/ApolloWebSocket-Target-Tests.xcconfig

This file was deleted.

3 changes: 3 additions & 0 deletions Configuration/Shared/Workspace-Target-Test.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ ENABLE_BITCODE = NO

// Disable some known troublesome warnings for the test target, as -Weverything without these exceptions causes errors when importing XCTest
WARNING_CFLAGS = $(inherited) -Wno-documentation-unknown-command -Wno-incomplete-module -Wno-disabled-macro-expansion -Wno-shadow

/// Test Target Deployment Target
MACOSX_DEPLOYMENT_TARGET = 10.15
18 changes: 14 additions & 4 deletions Sources/ApolloTestSupport/MockURLSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,24 @@ public final class MockURLSessionClient: URLSessionClient {
completion(.success((data, response)))
}
}

let mockTask = URLSessionDataTaskMock()

let mockTaskType: URLSessionDataTaskMockProtocol.Type = URLSessionDataTaskMock.self
let mockTask = mockTaskType.init() as! URLSessionDataTaskMock
return mockTask
}
}

private final class URLSessionDataTaskMock: URLSessionDataTask {
protocol URLSessionDataTaskMockProtocol {
init()
}

private final class URLSessionDataTaskMock: URLSessionDataTask, URLSessionDataTaskMockProtocol{

@available(macOS, deprecated: 10.15)
override init() {
super.init()
}

override func resume() {
// No-op
}
Expand Down

0 comments on commit 0c66480

Please sign in to comment.