Skip to content

Split up ConsoleOutputRecorder into two parts. #145

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 5 commits into from
Dec 4, 2023

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Nov 29, 2023

This PR splits Event.ConsoleOutputRecorder such that it only contains the code necessary to produce console output (that is, output destined for a terminal with ANSI escape codes, etc.)

The logic to produce human-readable text is moved to a separate type, Event.HumanReadableOutputRecorder. This type has no knowledge of where the text it generates will be rendered or consumed.

By splitting this type into two pieces, we (or external developers) can readily create new event-recording mechanisms that use the same text we do, but which translate that text to different representations such as HTML or AttributedString.

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

@grynspan grynspan force-pushed the jgrynspan/split-up-console-output branch from 4307707 to 504fd0d Compare November 29, 2023 23:02
@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan
Copy link
Contributor Author

@swift-ci please test Linux

@grynspan
Copy link
Contributor Author

@swift-ci please clean test Linux

@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan
Copy link
Contributor Author

@swift-ci please test Linux

1 similar comment
@grynspan
Copy link
Contributor Author

grynspan commented Dec 3, 2023

@swift-ci please test Linux

@grynspan grynspan added enhancement New feature or request tools integration 🛠️ Integration of swift-testing into tools/IDEs labels Dec 4, 2023
@grynspan grynspan self-assigned this Dec 4, 2023
This PR splits `Event.ConsoleOutputRecorder` such that it only contains the code necessary to produce _console output_ (that is, output destined for a terminal with ANSI escape codes, etc.)

The logic to produce human-readable text is moved to a separate type, `Event.HumanReadableOutputRecorder`. This type has no knowledge of where the text it generates will be rendered or consumed.

By splitting this type into two pieces, we (or external developers) can readily create new event-recording mechanisms that use the same text we do, but which translate that text to different representations such as HTML or `AttributedString`.
@grynspan grynspan force-pushed the jgrynspan/split-up-console-output branch from b58d72b to 8bd6ef2 Compare December 4, 2023 13:33
@grynspan
Copy link
Contributor Author

grynspan commented Dec 4, 2023

@swift-ci please test

@grynspan
Copy link
Contributor Author

grynspan commented Dec 4, 2023

@swift-ci please test Linux

1 similar comment
@grynspan
Copy link
Contributor Author

grynspan commented Dec 4, 2023

@swift-ci please test Linux

@grynspan grynspan requested a review from stmontgomery December 4, 2023 17:38
@grynspan
Copy link
Contributor Author

grynspan commented Dec 4, 2023

@swift-ci please test

@grynspan
Copy link
Contributor Author

grynspan commented Dec 4, 2023

@swift-ci please test

@grynspan
Copy link
Contributor Author

grynspan commented Dec 4, 2023

@swift-ci please test

@grynspan grynspan merged commit 35c97f7 into main Dec 4, 2023
@grynspan grynspan deleted the jgrynspan/split-up-console-output branch December 4, 2023 20:10
grynspan added a commit that referenced this pull request Dec 5, 2023
Accidentally omitted said newline in #145. This PR restores it. Currently, we use this code path when `XCTestScaffold` and `--enable-experimental-swift-testing` are used together.
grynspan added a commit that referenced this pull request Dec 5, 2023
…le. (#152)

Accidentally omitted said newline in #145. This PR restores it. Currently, we use this code path when `XCTestScaffold` and `--enable-experimental-swift-testing` are used together.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tools integration 🛠️ Integration of swift-testing into tools/IDEs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants