Skip to content

Commit 21ce9e0

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. Also, enable the two Workspace Traits tests that were added after swiftlang#8569 was merged. Relates to: swiftlang#8433 Issue: rdar://148248105
1 parent e84c0ba commit 21ce9e0

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
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: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16145,8 +16145,6 @@ final class WorkspaceTests: XCTestCase {
1614516145
}
1614616146

1614716147
func testInvalidTrait_WhenParentPackageEnablesTraits() async throws {
16148-
try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#)
16149-
1615016148
let sandbox = AbsolutePath("/tmp/ws/")
1615116149
let fs = InMemoryFileSystem()
1615216150

@@ -16208,8 +16206,6 @@ final class WorkspaceTests: XCTestCase {
1620816206
}
1620916207

1621016208
func testInvalidTraitConfiguration_ForRootPackage() async throws {
16211-
try skipOnWindowsAsTestCurrentlyFails(because: #"\tmp\ws doesn't exist in file system"#)
16212-
1621316209
let sandbox = AbsolutePath("/tmp/ws/")
1621416210
let fs = InMemoryFileSystem()
1621516211

0 commit comments

Comments
 (0)