Skip to content

Conversation

grynspan
Copy link
Contributor

This PR adds a Test.isRunning static property that tells the caller if any thread/task/queue/etc. is currently running Swift Testing code. This property is distinct from Test.current because that property has a value of nil on detached tasks.

Resolves #475.

Checklist:

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

This PR adds a `Test.isRunning` static property that tells the caller if _any_ thread/task/queue/etc. is currently running Swift Testing code. This property is distinct from `Test.current` because that property has a value of `nil` on detached tasks.

Resolves #475.
@grynspan grynspan added enhancement New feature or request tools integration 🛠️ Integration of swift-testing into tools/IDEs public-api Affects public API labels Jun 29, 2024
@grynspan grynspan self-assigned this Jun 29, 2024
@grynspan grynspan added this to the Swift 6.1 milestone Sep 10, 2024
@grynspan grynspan modified the milestones: Swift 6.1, Swift 6.2 Nov 19, 2024
@grynspan grynspan modified the milestones: Swift 6.2, Swift 6.x Apr 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request public-api Affects public API tools integration 🛠️ Integration of swift-testing into tools/IDEs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API to reliably detect if a test is running under Swift Testing or XCTest
1 participant