Skip to content

Commit 98b55ba

Browse files
authored
Merge pull request #1833 from ahoppen/fix-510-tests
Skip tests that use background indexing when running tests with a Swift 5.10 toolchain
2 parents bce0993 + c0c0f1f commit 98b55ba

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Sources/SKTestSupport/TestSourceKitLSPClient.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ package final class TestSourceKitLSPClient: MessageHandler, Sendable {
146146
preInitialization: ((TestSourceKitLSPClient) -> Void)? = nil,
147147
cleanUp: @Sendable @escaping () -> Void = {}
148148
) async throws {
149+
if enableBackgroundIndexing {
150+
try await SkipUnless.swiftPMSupportsExperimentalPrepareForIndexing()
151+
}
149152
var options = options
150153
if let globalModuleCache = try globalModuleCache {
151154
options.swiftPMOrDefault.swiftCompilerFlags =

Tests/SourceKitLSPTests/BackgroundIndexingTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,8 @@ final class BackgroundIndexingTests: XCTestCase {
542542
}
543543

544544
func testPrepareTargetAfterEditToDependency() async throws {
545+
try await SkipUnless.swiftPMSupportsExperimentalPrepareForIndexing()
546+
545547
var testHooks = TestHooks()
546548
let expectedPreparationTracker = ExpectedIndexTaskTracker(expectedPreparations: [
547549
[
@@ -641,6 +643,8 @@ final class BackgroundIndexingTests: XCTestCase {
641643
}
642644

643645
func testDontStackTargetPreparationForEditorFunctionality() async throws {
646+
try await SkipUnless.swiftPMSupportsExperimentalPrepareForIndexing()
647+
644648
let allDocumentsOpened = WrappedSemaphore(name: "All documents opened")
645649
let libBStartedPreparation = WrappedSemaphore(name: "LibB started preparing")
646650
let libDPreparedForEditing = WrappedSemaphore(name: "LibD prepared for editing")

0 commit comments

Comments
 (0)