-
Notifications
You must be signed in to change notification settings - Fork 108
Add a kind to Issue.record to record various kinds a of issues #1120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -92,6 +92,34 @@ extension Issue { | |||||
let issue = Issue(kind: .unconditional, severity: severity, comments: Array(comment), sourceContext: sourceContext) | ||||||
return issue.record() | ||||||
} | ||||||
|
||||||
/// Record an issue when a running test fails unexpectedly. | ||||||
/// | ||||||
/// - Parameters: | ||||||
/// - comment: A comment describing the expectation. | ||||||
/// - severity: The severity of the issue. | ||||||
/// - sourceLocation: The source location to which the issue should be | ||||||
/// attributed. | ||||||
/// - kind: The kind of the issue. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It should be deleted. |
||||||
/// | ||||||
/// - Returns: The issue that was recorded. | ||||||
/// | ||||||
/// Use this function if, while running a test, an issue occurs that cannot be | ||||||
/// represented as an expectation (using the ``expect(_:_:sourceLocation:)`` | ||||||
/// or ``require(_:_:sourceLocation:)-5l63q`` macros.) | ||||||
@_spi(Experimental) | ||||||
@_spi(ForToolsIntegrationOnly) | ||||||
@discardableResult public static func record( | ||||||
kind: Kind = .unconditional, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok now that this is a distinct overload, I think you'll need to make
Suggested change
|
||||||
comment: Comment? = nil, | ||||||
severity: Severity = .error, | ||||||
sourceLocation: SourceLocation = #_sourceLocation | ||||||
) -> Self { | ||||||
let sourceContext = SourceContext(backtrace: .current(), sourceLocation: sourceLocation) | ||||||
let issue = Issue(kind: kind, severity: severity, comments: Array(comment), sourceContext: sourceContext) | ||||||
return issue.record() | ||||||
} | ||||||
|
||||||
} | ||||||
|
||||||
// MARK: - Recording issues for errors | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.