Skip to content

Commit e8aff4b

Browse files
authored
Test: Guard a ManifestSourceGenerationTest and annotate skip message (#8582)
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 #8569 was merged. Relates to: #8433 Issue: rdar://148248105
1 parent 366e545 commit e8aff4b

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

Sources/_InternalTestSupport/XCTAssertHelpers.swift

+7
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ public func XCTRequires(
101101
}
102102
}
103103

104+
public func XCTSkipIfCompilerLessThan6_2() throws {
105+
#if compiler(>=6.2)
106+
#else
107+
throw XCTSkip("Skipping as compiler version is less thann 6.2")
108+
#endif
109+
}
110+
104111
/// An `async`-friendly replacement for `XCTAssertThrowsError`.
105112
public func XCTAssertAsyncThrowsError<T>(
106113
_ expression: @autoclosure () async throws -> T,

Tests/WorkspaceTests/ManifestSourceGenerationTests.swift

+2-2
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

-4
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 XCTSkipOnWindows(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 XCTSkipOnWindows(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)