Skip to content

Test: Guard a ManifestSourceGenerationTest and annotate skip message #8582

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

Merged
merged 1 commit into from
May 2, 2025
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions Sources/_InternalTestSupport/XCTAssertHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ public func XCTRequires(
}
}

public func XCTSkipIfCompilerLessThan6_2() throws {
#if compiler(>=6.2)
#else
throw XCTSkip("Skipping as compiler version is less thann 6.2")
#endif
}

/// An `async`-friendly replacement for `XCTAssertThrowsError`.
public func XCTAssertAsyncThrowsError<T>(
_ expression: @autoclosure () async throws -> T,
Expand Down
4 changes: 2 additions & 2 deletions Tests/WorkspaceTests/ManifestSourceGenerationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ final class ManifestSourceGenerationTests: XCTestCase {
}

func testStrictMemorySafety() async throws {
try XCTSkipOnWindows(because: "compilation error: type 'SwiftSetting' has no member 'strictMemorySafety'")
try XCTSkipIfCompilerLessThan6_2()

let manifestContents = """
// swift-tools-version:6.2
Expand Down Expand Up @@ -865,7 +865,7 @@ final class ManifestSourceGenerationTests: XCTestCase {
}

func testDefaultIsolation() async throws {
try XCTSkipOnWindows(because: "there are compilation errors")
try XCTSkipOnWindows(because: "https://github.com/swiftlang/swift-package-manager/issues/8543: there are compilation errors")

let manifest = Manifest.createRootManifest(
displayName: "pkg",
Expand Down
4 changes: 0 additions & 4 deletions Tests/WorkspaceTests/WorkspaceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16145,8 +16145,6 @@ final class WorkspaceTests: XCTestCase {
}

func testInvalidTrait_WhenParentPackageEnablesTraits() async throws {
try XCTSkipOnWindows(because: #"\tmp\ws doesn't exist in file system"#)

let sandbox = AbsolutePath("/tmp/ws/")
let fs = InMemoryFileSystem()

Expand Down Expand Up @@ -16208,8 +16206,6 @@ final class WorkspaceTests: XCTestCase {
}

func testInvalidTraitConfiguration_ForRootPackage() async throws {
try XCTSkipOnWindows(because: #"\tmp\ws doesn't exist in file system"#)

let sandbox = AbsolutePath("/tmp/ws/")
let fs = InMemoryFileSystem()

Expand Down