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

Inject XCTestCases directly into XCTest #7

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

Conversation

craffert0
Copy link

Rather than timing the insertion of XCTestCases into the runtime system to happen between static initialization of gtests and XCTest running the test, explicitly insert the XCTestCases when the tests are run.

This is done by having a single text case, GoogleTests, that has its own defaultTestSuite. That test suite wraps all the gtests the exact same way, and adds them to itself.

Also, deal with the fact that a gtest can have / in its name, and convert that to _.

…em to happen between static initialization of gtests and XCTest running the test, explicitly insert the XCTestCases when the tests are run.

This is done by having a single text case, `GoogleTests`, that has its own `defaultTestSuite`.  That test suite wraps all the gtests the exact same way, and adds them to itself.

Also, deal with the fact that a gtest can have `/` in its name, and convert that to `_`.
@oscahie
Copy link

oscahie commented Dec 17, 2018

This approach does not work well as of Xcode 10 (and possibly earlier versions too). You can run all the tests but not click to run on individual test cases, as that will always result in zero tests being executed.

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

Successfully merging this pull request may close these issues.

2 participants