diff --git a/Sources/ToolsProtocolsTestSupport/Assertions.swift b/Sources/ToolsProtocolsTestSupport/Assertions.swift index 4d621706..faf96c05 100644 --- a/Sources/ToolsProtocolsTestSupport/Assertions.swift +++ b/Sources/ToolsProtocolsTestSupport/Assertions.swift @@ -10,6 +10,7 @@ // //===----------------------------------------------------------------------===// +#if canImport(XCTest) package import XCTest /// Same as `XCTAssertNoThrow` but executes the trailing closure. @@ -181,3 +182,4 @@ package nonisolated func fulfillmentOfOrThrow( throw ExpectationNotFulfilledError(expectations: expectations) } } +#endif diff --git a/Sources/ToolsProtocolsTestSupport/CheckCoding.swift b/Sources/ToolsProtocolsTestSupport/CheckCoding.swift index 278d158d..5019a758 100644 --- a/Sources/ToolsProtocolsTestSupport/CheckCoding.swift +++ b/Sources/ToolsProtocolsTestSupport/CheckCoding.swift @@ -10,6 +10,7 @@ // //===----------------------------------------------------------------------===// +#if canImport(XCTest) import Foundation import XCTest @@ -112,3 +113,4 @@ package func checkCoding( body(decodedValue) } +#endif diff --git a/Sources/ToolsProtocolsTestSupport/PerfTestCase.swift b/Sources/ToolsProtocolsTestSupport/PerfTestCase.swift index ba716c49..badcbfe1 100644 --- a/Sources/ToolsProtocolsTestSupport/PerfTestCase.swift +++ b/Sources/ToolsProtocolsTestSupport/PerfTestCase.swift @@ -10,6 +10,7 @@ // //===----------------------------------------------------------------------===// +#if canImport(XCTest) public import XCTest /// Base class for a performance test case in SourceKit-LSP. @@ -52,3 +53,4 @@ open class PerfTestCase: XCTestCase { #endif } +#endif diff --git a/Sources/ToolsProtocolsTestSupport/RepeatUntilExpectedResult.swift b/Sources/ToolsProtocolsTestSupport/RepeatUntilExpectedResult.swift index 4ed718f4..34654051 100644 --- a/Sources/ToolsProtocolsTestSupport/RepeatUntilExpectedResult.swift +++ b/Sources/ToolsProtocolsTestSupport/RepeatUntilExpectedResult.swift @@ -10,6 +10,7 @@ // //===----------------------------------------------------------------------===// +#if canImport(XCTest) import SKLogging @_spi(SourceKitLSP) import ToolsProtocolsSwiftExtensions import XCTest @@ -35,3 +36,4 @@ package func repeatUntilExpectedResult( } XCTFail("Failed to get expected result", file: file, line: line) } +#endif diff --git a/Sources/ToolsProtocolsTestSupport/TestJSONRPCConnection.swift b/Sources/ToolsProtocolsTestSupport/TestJSONRPCConnection.swift index 7680cfce..d936cb22 100644 --- a/Sources/ToolsProtocolsTestSupport/TestJSONRPCConnection.swift +++ b/Sources/ToolsProtocolsTestSupport/TestJSONRPCConnection.swift @@ -10,6 +10,7 @@ // //===----------------------------------------------------------------------===// +#if canImport(XCTest) public import LanguageServerProtocol package import LanguageServerProtocolTransport @_spi(SourceKitLSP) import ToolsProtocolsSwiftExtensions @@ -233,3 +234,4 @@ package struct EchoNotification: NotificationType { self.string = string } } +#endif