[RFC] Who tests the tests? #3
Closed
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.
First of all, thanks so much for open-sourcing this!! 💘
I noticed this project doesn't have GitHub issues enabled, so I hope you'll consider this an RFC where we can discuss the issue further. Please let me know if I should email the swift-corelibs-dev mailing list instead.
I noticed that this project isn't itself unit tested. It'd be nice to add some tests, since those would enable us to work on it while avoiding regressions.
I could think of several ways to do test this project. The simplest would be running this version of XCTest on some sample programs and examining the output. Those programs would call
XCTMain()
from within theirmain()
function. Test output would be printed to stdout via theprint()
function. Tests for this project would then verify that what we expected was indeed printed to stdout.Another approach would be what's currently in this pull request: allowing consumers of XCTest to pass a list of reporters to their
XCTMain()
function. These reporters would respond to a set of messages, similar toXCTestObservation.h
in the Apple version of XCTest. From within this project's unit tests, we could then pass aTestReporter
that captures the messages it's sent. We can then verify it was sent the expected messages.Let me know your preferred approach, or any other thoughts you may have. Thanks!