Skip to content

[Tests] NFC: Add a package loading test for .defaultIsolation setting #8461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions Tests/PackageLoadingTests/PD_6_2_LoadingTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift open source project
//
// Copyright (c) 2023-2025 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

import _InternalTestSupport
import Basics
import PackageModel
import SourceControl
import XCTest

final class PackageDescription6_2LoadingTests: PackageDescriptionLoadingTests {
override var toolsVersion: ToolsVersion {
.v6_2
}

func testDefaultIsolationPerTarget() async throws {
let content = """
import PackageDescription
let package = Package(
name: "Foo",
defaultLocalization: "be",
products: [],
targets: [
.target(
name: "Foo",
swiftSettings: [
.defaultIsolation(nil)
]
),
.target(
name: "Bar",
swiftSettings: [
.defaultIsolation(MainActor.self)
]
)
]
)
"""

let observability = ObservabilitySystem.makeForTesting()
let (_, validationDiagnostics) = try await loadAndValidateManifest(
content,
observabilityScope: observability.topScope
)
XCTAssertNoDiagnostics(validationDiagnostics)
XCTAssertNoDiagnostics(observability.diagnostics)
}
}