-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add swift build --enable-code-coverage
#7518
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR adds the `--enable-code-coverage` flag (from `swift test`) to `swift build` so that code coverage can be used in a two-stage build process (build, then execute later.) Resolves rdar://127309781.
@swift-ci please test |
MaxDesiatov
approved these changes
Apr 30, 2024
plemarquand
added a commit
to plemarquand/vscode-swift
that referenced
this pull request
May 1, 2024
Support running swift-testing tests the same as XCTests. If a test run has both types, swift-testing tests will be run first followed by XCTests. First a list of XCTests and swift-testing tests to run is parsed from the test request. Test type is determined by a tag on each vscode.TestItem[], either `"XCTest"` or `"swift-testing"`. swift-testing tests are launched by running the binary named <PackageName>PackageTests.swift-testing inside the build debug folder. This binary is run with the `--experimental-event-stream-output` flag which forwards test events (test started, complete, issue recorded, etc) to a named pipe. The `SwiftTestingOutputParser` watches this pipe for events as the tests are being run and translates them in to `ITestRunner` calls to record test progress in VSCode. There are different named pipe reader implementations between macOS/Linux and Windows. TODO: Coverage on swift-testing tests is not supported until swiftlang/swift-package-manager#7518 is available.
plemarquand
added a commit
to plemarquand/vscode-swift
that referenced
this pull request
May 1, 2024
Support running swift-testing tests the same as XCTests. If a test run has both types, swift-testing tests will be run first followed by XCTests. First a list of XCTests and swift-testing tests to run is parsed from the test request. Test type is determined by a tag on each `vscode.TestItem[]`, either `"XCTest"` or `"swift-testing"`. swift-testing tests are launched by running the binary named <PackageName>PackageTests.swift-testing inside the build debug folder. This binary is run with the `--experimental-event-stream-output` flag which forwards test events (test started, complete, issue recorded, etc) to a named pipe. The `SwiftTestingOutputParser` watches this pipe for events as the tests are being run and translates them in to `ITestRunner` calls to record test progress in VSCode. There are different named pipe reader implementations between macOS/Linux and Windows. TODO: Coverage on swift-testing tests is not supported until swiftlang/swift-package-manager#7518 is available.
plemarquand
added a commit
to plemarquand/vscode-swift
that referenced
this pull request
May 1, 2024
Support running swift-testing tests the same as XCTests. If a test run has both types, swift-testing tests will be run first followed by XCTests. First a list of XCTests and swift-testing tests to run is parsed from the test request. Test type is determined by a tag on each `vscode.TestItem[]`, either `"XCTest"` or `"swift-testing"`. swift-testing tests are launched by running the binary named <PackageName>PackageTests.swift-testing inside the build debug folder. This binary is run with the `--experimental-event-stream-output` flag which forwards test events (test started, complete, issue recorded, etc) to a named pipe. The `SwiftTestingOutputParser` watches this pipe for events as the tests are being run and translates them in to `ITestRunner` calls to record test progress in VSCode. There are different named pipe reader implementations between macOS/Linux and Windows. TODO: Coverage on swift-testing tests is not supported until swiftlang/swift-package-manager#7518 is available.
plemarquand
added a commit
to plemarquand/vscode-swift
that referenced
this pull request
May 12, 2024
Support running swift-testing tests the same as XCTests. If a test run has both types, swift-testing tests will be run first followed by XCTests. First a list of XCTests and swift-testing tests to run is parsed from the test request. Test type is determined by a tag on each `vscode.TestItem[]`, either `"XCTest"` or `"swift-testing"`. swift-testing tests are launched by running the binary named <PackageName>PackageTests.swift-testing inside the build debug folder. This binary is run with the `--experimental-event-stream-output` flag which forwards test events (test started, complete, issue recorded, etc) to a named pipe. The `SwiftTestingOutputParser` watches this pipe for events as the tests are being run and translates them in to `ITestRunner` calls to record test progress in VSCode. There are different named pipe reader implementations between macOS/Linux and Windows. TODO: Coverage on swift-testing tests is not supported until swiftlang/swift-package-manager#7518 is available.
furby-tm
pushed a commit
to wabiverse/swift-package-manager
that referenced
this pull request
May 15, 2024
This PR adds the `--enable-code-coverage` flag (from `swift test`) to `swift build` so that code coverage can be used in a two-stage build process (build, then execute later.) Resolves rdar://127309781.
grynspan
added a commit
that referenced
this pull request
May 15, 2024
grynspan
added a commit
that referenced
this pull request
May 15, 2024
Explanation: Add `--enable-code-coverage` to `swift build`. This flag allows enabling code coverage when splitting a test run between `swift build` and `swift test --skip-build`. Scope: New option for the `swift build` command. Original PR: #7508 (partial), #7518 Risk: Low. Behaviour is identical for `swift build` without the new flag, and the new flag must be explicitly specified. Testing: Ran `swift build` unit tests at desk and in CI. Reviewer: @bnbarham, @MaxDesiatov, @stmontgomery --------- Co-authored-by: Max Desiatov <[email protected]>
furby-tm
pushed a commit
to wabiverse/swift-package-manager
that referenced
this pull request
May 15, 2024
This PR adds the `--enable-code-coverage` flag (from `swift test`) to `swift build` so that code coverage can be used in a two-stage build process (build, then execute later.) Resolves rdar://127309781.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
command-line interface
enhancement
swift build
Changes impacting `swift build`
swift test
Changes impacting `swift test` tool
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the
--enable-code-coverage
flag (fromswift test
) toswift build
so that code coverage can be used in a two-stage build process (build, then execute later.)Resolves rdar://127309781.
Resolves #7373.