-
Notifications
You must be signed in to change notification settings - Fork 131
Augment JSON ABI #1429
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?
Augment JSON ABI #1429
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 |
|---|---|---|
|
|
@@ -157,10 +157,23 @@ additional `"testCases"` field describing the individual test cases. | |
| ["displayName": <string>,] ; the user-supplied custom display name | ||
| "sourceLocation": <source-location>, ; where the test is defined | ||
| "id": <test-id>, | ||
| "isParameterized": <bool> ; is this a parameterized test function or not? | ||
| "isParameterized": <bool>, ; is this a parameterized test function or not? | ||
| ["tags": <array:tag>,] ; the tags associated with this test function | ||
| ["bugs": <array:bug>,] ; the bugs associated with this test function | ||
| ["timeLimit": <number>] ; the time limit associated with this test function | ||
| } | ||
| <test-id> ::= <string> ; an opaque string representing the test case | ||
| <tags> ::= <string> ; a string representation of a tag | ||
| <bug> ::= { | ||
| ["url": <string>,] ; the bug url | ||
| ["id": <string>,] ; the bug id | ||
| "title": <string> ; the human readable bug title | ||
|
Contributor
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.
|
||
| } ; | ||
| ``` | ||
|
|
||
| <!-- | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||||||||||
| // | ||||||||||||||
| // This source file is part of the Swift.org open source project | ||||||||||||||
| // | ||||||||||||||
| // Copyright (c) 2024 Apple Inc. and the Swift project authors | ||||||||||||||
| // Copyright (c) 2024-2025 Apple Inc. and the Swift project authors | ||||||||||||||
| // Licensed under Apache License v2.0 with Runtime Library Exception | ||||||||||||||
| // | ||||||||||||||
| // See https://swift.org/LICENSE.txt for license information | ||||||||||||||
|
|
@@ -74,9 +74,13 @@ extension ABI { | |||||||||||||
| var isParameterized: Bool? | ||||||||||||||
|
|
||||||||||||||
| /// The tags associated with the test. | ||||||||||||||
| /// | ||||||||||||||
| /// - Warning: Tags are not yet part of the JSON schema. | ||||||||||||||
| var _tags: [String]? | ||||||||||||||
| var tags: [String]? | ||||||||||||||
|
Contributor
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.
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| // The bugs associated with the test. | ||||||||||||||
|
Contributor
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.
Suggested change
|
||||||||||||||
| var bugs: [Bug]? | ||||||||||||||
|
|
||||||||||||||
| /// The time limits associated with the test. | ||||||||||||||
|
Contributor
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.
Suggested change
|
||||||||||||||
| var timeLimit: Int? | ||||||||||||||
|
Contributor
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.
Suggested change
Subsecond precision is possible, at least nominally. |
||||||||||||||
|
|
||||||||||||||
| init(encoding test: borrowing Test) { | ||||||||||||||
| if test.isSuite { | ||||||||||||||
|
|
@@ -95,10 +99,23 @@ extension ABI { | |||||||||||||
| if isParameterized == true { | ||||||||||||||
| _testCases = test.uncheckedTestCases?.map(EncodedTestCase.init(encoding:)) | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| if V.versionNumber >= ABI.v6_3.versionNumber { | ||||||||||||||
| let tags = test.tags | ||||||||||||||
| if !tags.isEmpty { | ||||||||||||||
| _tags = tags.map(String.init(describing:)) | ||||||||||||||
| self.tags = tags.map(String.init(describing:)) | ||||||||||||||
| } | ||||||||||||||
| // From version 6.3 onwards, bugs are included as an experimental | ||||||||||||||
| // field. | ||||||||||||||
| let bugs = test.traits.compactMap { $0 as? Bug } | ||||||||||||||
| if !bugs.isEmpty { | ||||||||||||||
| self.bugs = bugs | ||||||||||||||
| } | ||||||||||||||
| if #available(_clockAPI , *) { | ||||||||||||||
| if let seconds = test.timeLimit?.components.seconds { | ||||||||||||||
|
Contributor
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.
Suggested change
(Brain-compiled.) |
||||||||||||||
| self.timeLimit = Int(seconds) | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
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.
(Nitpick)