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

Set an environment variable in swift test to indicate which testing library is in use. #7573

Merged
merged 3 commits into from
May 17, 2024

Conversation

grynspan
Copy link
Contributor

This PR sets a new environment variable "SWIFT_PM_TEST_LIBRARY" to the name of the active testing library ("XCTest" or "swift-testing".) Code in these libraries can then use the presence of this environment variable to adjust their behaviour.

Resolves rdar://128272138.

… library is in use.

This PR sets a new environment variable `"SWIFT_PM_TEST_LIBRARY"` to the name of
the active testing library (`"XCTest"` or `"swift-testing"`.) Code in these
libraries can then use the presence of this environment variable to adjust their
behaviour.

Resolves rdar://128272138.
@grynspan grynspan added bug swift test Changes impacting `swift test` tool labels May 17, 2024
@grynspan grynspan self-assigned this May 17, 2024
@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan grynspan enabled auto-merge (squash) May 17, 2024 18:03
@grynspan
Copy link
Contributor Author

@swift-ci please test Windows

@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan
Copy link
Contributor Author

@swift-ci please test Windows

@grynspan grynspan merged commit c965d5a into main May 17, 2024
5 checks passed
@grynspan grynspan deleted the jgrynspan/128272138-envvar-for-active-test-library branch May 17, 2024 23:28
grynspan added a commit that referenced this pull request May 17, 2024
…esting library is in use. (#7577)

**Explanation**: Allows swift-testing and XCTest to detect at runtime
which testing library SwiftPM is trying to run so that they can adjust
their behaviour (e.g. `XCTestScaffold`) appropriately.
**Scope**: Test build products at runtime.
**Risk**: Low. No obvious risk here to adding a new environment variable
nobody is looking for.
**Testing**: New unit test (tested at desk, but must be temporarily
disabled in CI until CI is running a version of SwiftPM that includes
the change.)
**Original PR**:
#7573
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug swift test Changes impacting `swift test` tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants