swift-testing icon indicating copy to clipboard operation
swift-testing copied to clipboard

Adopt `#if objectFormat()`

Open grynspan opened this issue 1 month ago • 0 comments

Adopt #if objectFormat() in _TestDiscovery and in the @Test/@Suite/#expect(processExitsWith:) macro implementations.

We'll need to wait a release (presumably until 6.4) to adopt because we can't write:

#if objectFormat(ELF)
// ELF implementation
#else ...

And have it compile on 6.2 toolchains. Using os() is sufficient for now.

See: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0492-section-control.md

grynspan avatar Oct 17 '25 17:10 grynspan