Skip to content
Open
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
22 changes: 22 additions & 0 deletions Tests/FunctionalTests/TestDiscoveryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -319,4 +319,26 @@ struct TestDiscoveryTests {
buildSystem == .swiftbuild && ProcessInfo.hostOperatingSystem == .windows
}
}
@Test(arguments: SupportedBuildSystemOnAllPlatforms)
func testWithSanitizeAndFilterFailsWithPlatformPolicyViolation(
_ buildSystem: BuildSystemProvider.Kind
) async throws {
#if os(macOS)
try await withKnownIssue(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: indentation looks off; I'd expect the body of this whole function to be indented one level

"Fails due to swiftpm-xctest-helper (Xcode tool) violating platform sanitizer policy (#9546, rdar://168234231)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the part I commented on/suggested, and that part LGTM! Thanks

) {
try await fixture(name: "Miscellaneous/TestDiscovery/Simple") { fixturePath in
let (_, stderr) = try await executeSwiftTest(
fixturePath,
extraArgs: ["--sanitize", "address", "--filter", "testExample"],
buildSystem: buildSystem
)

#expect(stderr.contains("Sanitizer load violates platform policy"))
}
}
#else
throw SkipTest("Sanitizer + filter behavior is macOS-specific")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd generally recommend an .enabled(if:) for expressing that a particular test is only relevant on certain platforms

#endif

}