Skip to content

Commit b6c646f

Browse files
authored
Ensure issues with warning severity are delivered to Xcode. (#1529)
This PR adjusts the logic we use to decide whether or not to suppress issues with warning severity so that Swift Testing, when built as a package, reports them to Xcode. Xcode 26.0 and later support different issue severities (this branch of Swift Testing no longer supports earlier versions of Xcode.) Resolves rdar://169741898. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
1 parent b986343 commit b6c646f

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

Sources/Testing/ABI/EntryPoints/EntryPoint.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,11 @@ public func configurationForEntryPoint(from args: __CommandLineArguments_v0) thr
673673

674674
// Warning issues (experimental).
675675
switch args.eventStreamVersionNumber {
676+
#if !SWT_NO_SNAPSHOT_TYPES
677+
case .some(ABI.Xcode16.versionNumber):
678+
// Xcode 26 and later support warning severity, so leave it enabled.
679+
break
680+
#endif
676681
case .some(..<ABI.v6_3.versionNumber):
677682
// If the event stream version was explicitly specified to a value < 6.3,
678683
// disable the warning issue event to maintain legacy behavior.

Tests/TestingTests/SwiftPMTests.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,16 @@ struct SwiftPMTests {
323323
#expect(versionTypeInfo == nil)
324324
}
325325

326+
#if !SWT_NO_SNAPSHOT_TYPES
327+
@Test("Severity field included in Issue.Snapshot")
328+
func issueSnapshotIncludesSeverity() async throws {
329+
let configuration = try configurationForEntryPoint(
330+
withArguments: ["PATH", "--event-stream-version", "-1"]
331+
)
332+
#expect(configuration.eventHandlingOptions.isWarningIssueRecordedEventEnabled)
333+
}
334+
#endif
335+
326336
@Test("Severity and isFailure fields included in version 6.3")
327337
func validateEventStreamContents() async throws {
328338
let tempDirPath = try temporaryDirectory()

0 commit comments

Comments
 (0)