Skip to content

[6.2] Emit "barriers" into the stdout/stderr streams of an exit test. #1220

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

Merged
merged 1 commit into from
Jul 11, 2025

Conversation

grynspan
Copy link
Contributor

This PR causes Swift Testing to write "barriers" (known sequences of
bytes) to `stdout` and `stderr` in the child process created by an exit
test. Then, in the parent, these values are used to splice off any
leading or trailing output that wasn't generated by the exit test's body
(such as content generated by the host process, XCTest/Xcode, etc.)

This reduces the amount of extraneous data reported back to the exit
test's parent process.

Thanks to @briancroom for the suggestion.

### 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.
@grynspan
Copy link
Contributor Author

@swift-ci test

@grynspan grynspan self-assigned this Jul 10, 2025
@grynspan grynspan added bug 🪲 Something isn't working tools integration 🛠️ Integration of swift-testing into tools/IDEs workaround Workaround for an issue in another component (may need to revert later) exit-tests ☠️ Work related to exit tests command-line experience ⌨️ enhancements to the command line interface labels Jul 10, 2025
@grynspan grynspan added this to the Swift 6.2 milestone Jul 10, 2025
@grynspan grynspan merged commit 1c9c9af into release/6.2 Jul 11, 2025
3 checks passed
@grynspan grynspan deleted the jgrynspan/exit-test-barriers-6.2 branch July 11, 2025 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working command-line experience ⌨️ enhancements to the command line interface exit-tests ☠️ Work related to exit tests tools integration 🛠️ Integration of swift-testing into tools/IDEs workaround Workaround for an issue in another component (may need to revert later)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants