Skip to content

Commit c82728d

Browse files
committed
Test: Guard a ManifestSourceGenerationTest and annotateskip message
Guard a test in ManifestSourceGenerationTest based on the compiler version, and annotate skipped tests with a GitHub issue. Relates to: #8433 Issue: rdar://148248105
1 parent e84c0ba commit c82728d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Sources/_InternalTestSupport/XCTAssertHelpers.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ public func XCTSkipOnWindows(because reason: String? = nil, skipPlatformCi: Bool
7676
#endif
7777
}
7878

79+
public func XCTSkipIfCompilerLessThan6_2() throws {
80+
#if compiler(>=6.2)
81+
#else
82+
throw XCTSkip("Skipping as compiler version is less thann 6.2")
83+
#endif
84+
}
85+
7986
/// An `async`-friendly replacement for `XCTAssertThrowsError`.
8087
public func XCTAssertAsyncThrowsError<T>(
8188
_ expression: @autoclosure () async throws -> T,

Tests/WorkspaceTests/ManifestSourceGenerationTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ final class ManifestSourceGenerationTests: XCTestCase {
796796
}
797797

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

801801
let manifestContents = """
802802
// swift-tools-version:6.2
@@ -865,7 +865,7 @@ final class ManifestSourceGenerationTests: XCTestCase {
865865
}
866866

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

870870
let manifest = Manifest.createRootManifest(
871871
displayName: "pkg",

0 commit comments

Comments
 (0)