You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Darwin, allow XCTest to be missing if we're only building swift-testing tests.
This PR removes the constraint on Darwin that XCTest.framework must be present
in order to build tests using swift-testing. On Darwin, XCTest is included as a
framework inside Xcode, but if a developer installs the Xcode Command Line Tools
instead of the full IDE, XCTest is not included. They then get a diagnostic of
the form:
> error: XCTest not available: terminated(1): /usr/bin/xcrun --sdk macosx --show-sdk-platform-path output:
> xcrun: error: unable to lookup item 'PlatformPath' from command line tools installation
> xcrun: error: unable to lookup item 'PlatformPath' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk'
Which is a poor experience if they aren't even using XCTest.
This change, as a (positive) side effect, suppresses the same diagnostic when
running commands that are not usually dependent on the presence of XCTest such
as `swift build`.
Note that swift-corelibs-xctest is not supported on Darwin, so installing the
Xcode Command Line Tools and adding an explicit dependency on
swift-corelibs-xctest will not produce a functional test target bundle.
Supporting swift-corelibs-xctest on Darwin is a potential future direction.
Automated testing for this change is difficult because it relies on a build
environment that is not supported in CI (namely the presence of the CL tools but
not Xcode nor XCTest.framework.) I have manually tested the change against
swift-testing's own test target.
A separate PR will be necessary in swift-testing to remove some remaining XCTest
dependencies. Those changes are not covered by this PR.
Resolves rdar://125372431.
0 commit comments