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

Ignore the --testing-library argument we are going to start passing from SwiftPM. #490

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

grynspan
Copy link
Contributor

This PR adds functionality to XCTest's argument parser that allows it to skip arguments that the caller may specify but which are uninteresting to XCTest. Specifically, we are planning to start passing --testing-library xctest to the test runner process in order to disambiguate runs of XCTest from runs of Swift Testing, and we need to make sure this does not cause XCTest to run incorrectly.

Resolves rdar://129695171.

… from SwiftPM.

This PR adds functionality to XCTest's argument parser that allows it to skip
arguments that the caller may specify but which are uninteresting to XCTest.
Specifically, we are planning to start passing `--testing-library xctest` to the
test runner process in order to disambiguate runs of XCTest from runs of Swift
Testing, and we need to make sure this does not cause XCTest to run incorrectly.

Resolves rdar://129695171.
@grynspan grynspan self-assigned this Jun 12, 2024
@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan
Copy link
Contributor Author

@swift-ci please test

}

let arguments = ["main", "--testing-library=xctest", "--testing-library", "xctest", "\(String(reflecting: ArgumentParsingTestCase.self))/testSuccess", "--testing-library",]
XCTMain([testCase(ArgumentParsingTestCase.allTests)], arguments: arguments)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be any checks on the output/result from this? Does this test fail (and how) without the product code change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test checks the exit code of the process, which should be non-zero if argument parsing failed.

That's my read anyway—you know this code better than I do.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, sure, makes sense from re-reading the code.

@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan
Copy link
Contributor Author

@swift-ci please test Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants