Skip to content

Commit 854b7f7

Browse files
author
Tiziano Coroneo
committed
Added same availability check to the tests for ApolloCodegen
1 parent 9aff812 commit 854b7f7

11 files changed

Lines changed: 53 additions & 0 deletions

Tests/ApolloCodegenTests/ASTParsingTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
import XCTest
1010
@testable import ApolloCodegenLib
1111

12+
// Only available on macOS
13+
#if os(macOS)
14+
1215
class ASTParsingTests: XCTestCase {
1316

1417
lazy var starWarsJSONURL: URL = {
@@ -786,3 +789,5 @@ query TwoHeroes {\n r2: hero {\n __typename\n name\n }\n luke: hero(epi
786789
}
787790
}
788791
}
792+
793+
#endif

Tests/ApolloCodegenTests/ApolloCodegenTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
import XCTest
1010
@testable import ApolloCodegenLib
1111

12+
// Only available on macOS
13+
#if os(macOS)
14+
1215
class ApolloCodegenTests: XCTestCase {
1316

1417
override func setUp() {
@@ -151,3 +154,5 @@ class ApolloCodegenTests: XCTestCase {
151154
XCTAssertEqual(contents.count, 17)
152155
}
153156
}
157+
158+
#endif

Tests/ApolloCodegenTests/ApolloSchemaTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
import XCTest
1010
@testable import ApolloCodegenLib
1111

12+
// Only available on macOS
13+
#if os(macOS)
14+
1215
class ApolloSchemaTests: XCTestCase {
1316

1417
private lazy var endpointURL = URL(string: "http://localhost:8080/graphql")!
@@ -122,3 +125,5 @@ class ApolloSchemaTests: XCTestCase {
122125
XCTAssertFalse(FileManager.default.apollo_fileExists(at: options.outputURL))
123126
}
124127
}
128+
129+
#endif

Tests/ApolloCodegenTests/CLIDownloaderTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
@testable import ApolloCodegenLib
1010
import XCTest
1111

12+
// Only available on macOS
13+
#if os(macOS)
14+
1215
class CLIDownloaderTests: XCTestCase {
1316

1417
func testRedownloading() throws {
@@ -43,3 +46,4 @@ class CLIDownloaderTests: XCTestCase {
4346
}
4447
}
4548

49+
#endif

Tests/ApolloCodegenTests/CLIExtractorTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
import XCTest
1010
@testable import ApolloCodegenLib
1111

12+
// Only available on macOS
13+
#if os(macOS)
14+
1215
class CLIExtractorTests: XCTestCase {
1316

1417
override func setUp() {
@@ -189,3 +192,5 @@ class CLIExtractorTests: XCTestCase {
189192
self.validateCLIIsExtractedWithRealSHASUM()
190193
}
191194
}
195+
196+
#endif

Tests/ApolloCodegenTests/CodegenExtensionTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
import XCTest
1010
@testable import ApolloCodegenLib
1111

12+
// Only available on macOS
13+
#if os(macOS)
14+
1215
class CodegenExtensionTests: XCTestCase {
1316

1417
// MARK: - Optional Boolean
@@ -52,3 +55,5 @@ class CodegenExtensionTests: XCTestCase {
5255
}
5356

5457
}
58+
59+
#endif

Tests/ApolloCodegenTests/CodegenTestHelper.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
import XCTest
1010
@testable import ApolloCodegenLib
1111

12+
// Only available on macOS
13+
#if os(macOS)
14+
1215
struct CodegenTestHelper {
1316

1417
// Centralized timeout for adjustment when working on terrible wifi
@@ -106,3 +109,5 @@ struct CodegenTestHelper {
106109
contents: shasum.data(using: .utf8))
107110
}
108111
}
112+
113+
#endif

Tests/ApolloCodegenTests/FileManagerExtensionsTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ import Foundation
1010
import XCTest
1111
@testable import ApolloCodegenLib
1212

13+
// Only available on macOS
14+
#if os(macOS)
15+
1316
class FileManagerExtensionsTests: XCTestCase {
1417

1518
override func setUp() {
@@ -48,3 +51,4 @@ class FileManagerExtensionsTests: XCTestCase {
4851
}
4952
}
5053

54+
#endif

Tests/ApolloCodegenTests/JSONTestHelpers.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import Foundation
22

3+
// Only available on macOS
4+
#if os(macOS)
5+
36
enum ConvenienceEncodingError: Error {
47
case couldntConvertDataToString
58
case couldntConvertStringToData
@@ -36,3 +39,5 @@ public extension Decodable {
3639
self = try decoder.decode(Self.self, from: data)
3740
}
3841
}
42+
43+
#endif

Tests/ApolloCodegenTests/JSONTests.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
import XCTest
1010
import ApolloCodegenLib
1111

12+
// Only available on macOS
13+
#if os(macOS)
14+
1215
class JSONContainerTests: XCTestCase {
1316

1417
func testSingleLevelDictionary() throws {
@@ -208,3 +211,5 @@ class JSONContainerTests: XCTestCase {
208211
}
209212
}
210213
}
214+
215+
#endif

0 commit comments

Comments
 (0)