Skip to content

Conversation

@Viditgupta-official
Copy link

@Viditgupta-official Viditgupta-official commented Dec 28, 2025

Add functional test covering swift test --sanitize --filter failure

Motivation:

When running swift test on macOS with both --sanitize address and --filter enabled, test execution fails with the error:

Sanitizer load violates platform policy.

Running either flag independently works as expected, but the combination consistently fails. This behavior is currently undocumented and untested. Adding coverage ensures the issue is reproducible and prevents accidental regressions while the underlying cause is investigated.

Modifications:

Added a new functional test in TestDiscoveryTests

Used SwiftPM’s functional test harness to invoke swift test

Passed --sanitize address and --filter together

Asserted on the observed platform policy violation message

Guarded the test to macOS

Result:

The sanitizer + filter failure is now captured by SwiftPM’s test suite, making the behavior explicit and providing a stable foundation for future fixes or refactors.
Fixes #9546

@Viditgupta-official
Copy link
Author

This PR intentionally only adds coverage for the sanitizer + filter behavior.
I plan to investigate the root cause of the sanitizer runtime loading failure in a follow-up change once this test is in place.

@Viditgupta-official
Copy link
Author

Note: This test documents a known failure that appears to originate in the swiftpm-xctest-helper (an Xcode tool), not SwiftPM itself.

The test is intentionally added as coverage to prevent regressions and to make the behavior explicit while the underlying issue is tracked separately (via Apple Feedback).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

swift test --filter with --sanitize fails: "Sanitizer load violates platform policy"

1 participant