Skip to content
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

Emit "barriers" into the stdout/stderr streams of an exit test. #1049

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Apr 4, 2025

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:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

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.
@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 Apr 4, 2025
@grynspan grynspan added this to the Swift 6.2 milestone Apr 4, 2025
@grynspan grynspan self-assigned this Apr 4, 2025
@grynspan grynspan modified the milestones: Swift 6.2, Swift 6.x Apr 6, 2025
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.

1 participant