Skip to content

Commit 9392ce4

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: swiftlang#8433 Issue: rdar://148248105
1 parent e84c0ba commit 9392ce4

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
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",

Tests/WorkspaceTests/WorkspaceTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16145,7 +16145,7 @@ final class WorkspaceTests: XCTestCase {
1614516145
}
1614616146

1614716147
func testInvalidTrait_WhenParentPackageEnablesTraits() async throws {
16148-
try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#)
16148+
try XCTSkipOnWindows(because: #"\tmp\ws doesn't exist in file system"#)
1614916149

1615016150
let sandbox = AbsolutePath("/tmp/ws/")
1615116151
let fs = InMemoryFileSystem()
@@ -16208,7 +16208,7 @@ final class WorkspaceTests: XCTestCase {
1620816208
}
1620916209

1621016210
func testInvalidTraitConfiguration_ForRootPackage() async throws {
16211-
try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#)
16211+
try XCTSkipOnWindows(because: #"\tmp\ws doesn't exist in file system"#)
1621216212

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

0 commit comments

Comments
 (0)