From bd0d70f7d5dc708ff9fd1868ddc9923e65f3a578 Mon Sep 17 00:00:00 2001 From: Stefana Dranca Date: Sun, 14 Jan 2024 10:40:03 +0000 Subject: [PATCH 1/2] Add missing compiler directive to ClientCodeTranslatorSnippetBasedTests.swift Motivation: A missing compiler directive to avoid compiling the snippet-based tests in non-macOS/Linux platforms was causing the build to fail on iOS/tvOS/watchOS. Modifications: Add the compiler directive. Result: Builds won't fail again in iOS/tvOS/watchOS. --- .../Translator/ClientCodeTranslatorSnippetBasedTests.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tests/GRPCCodeGenTests/Internal/Translator/ClientCodeTranslatorSnippetBasedTests.swift b/Tests/GRPCCodeGenTests/Internal/Translator/ClientCodeTranslatorSnippetBasedTests.swift index 144749390..8c33d5e44 100644 --- a/Tests/GRPCCodeGenTests/Internal/Translator/ClientCodeTranslatorSnippetBasedTests.swift +++ b/Tests/GRPCCodeGenTests/Internal/Translator/ClientCodeTranslatorSnippetBasedTests.swift @@ -14,6 +14,8 @@ * limitations under the License. */ +#if os(macOS) || os(Linux) // swift-format doesn't like canImport(Foundation.Process) + import XCTest @testable import GRPCCodeGen @@ -540,3 +542,5 @@ final class ClientCodeTranslatorSnippetBasedTests: XCTestCase { try XCTAssertEqualWithDiff(contents, expectedSwift) } } + +#endif // os(macOS) || os(Linux) From a3f8a35a502b1181e0d2c12d0f13ea4c28660d67 Mon Sep 17 00:00:00 2001 From: Stefana Dranca Date: Mon, 15 Jan 2024 09:56:56 +0000 Subject: [PATCH 2/2] fixed formatting --- .../Translator/ClientCodeTranslatorSnippetBasedTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/GRPCCodeGenTests/Internal/Translator/ClientCodeTranslatorSnippetBasedTests.swift b/Tests/GRPCCodeGenTests/Internal/Translator/ClientCodeTranslatorSnippetBasedTests.swift index 8c33d5e44..6e4daa1a6 100644 --- a/Tests/GRPCCodeGenTests/Internal/Translator/ClientCodeTranslatorSnippetBasedTests.swift +++ b/Tests/GRPCCodeGenTests/Internal/Translator/ClientCodeTranslatorSnippetBasedTests.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -#if os(macOS) || os(Linux) // swift-format doesn't like canImport(Foundation.Process) +#if os(macOS) || os(Linux) // swift-format doesn't like canImport(Foundation.Process) import XCTest