diff --git a/Package.swift b/Package.swift index aa32ba1e384..a3aaa4c4ab7 100644 --- a/Package.swift +++ b/Package.swift @@ -991,28 +991,6 @@ let package = Package( name: "SwiftBuildSupportTests", dependencies: ["SwiftBuildSupport", "_InternalTestSupport", "_InternalBuildTestSupport"] ), - // Examples (These are built to ensure they stay up to date with the API.) - .executableTarget( - name: "package-info", - dependencies: ["Workspace"], - path: "Examples/package-info/Sources/package-info" - ) - ], - swiftLanguageModes: [.v5] -) - -#if canImport(Darwin) -package.targets.append(contentsOf: [ - .executableTarget( - name: "swiftpm-testing-helper" - ) -]) -#endif - -// rdar://101868275 "error: cannot find 'XCTAssertEqual' in scope" can affect almost any functional test, so we flat out -// disable them all until we know what is going on -if ProcessInfo.processInfo.environment["SWIFTCI_DISABLE_SDK_DEPENDENT_TESTS"] == nil { - package.targets.append(contentsOf: [ .testTarget( name: "FunctionalTests", dependencies: [ @@ -1055,9 +1033,23 @@ if ProcessInfo.processInfo.environment["SWIFTCI_DISABLE_SDK_DEPENDENT_TESTS"] == "dummy-swiftc", ] ), - ]) -} + // Examples (These are built to ensure they stay up to date with the API.) + .executableTarget( + name: "package-info", + dependencies: ["Workspace"], + path: "Examples/package-info/Sources/package-info" + ), + ], + swiftLanguageModes: [.v5] +) +#if canImport(Darwin) +package.targets.append(contentsOf: [ + .executableTarget( + name: "swiftpm-testing-helper" + ) +]) +#endif func swiftSyntaxDependencies(_ names: [String]) -> [Target.Dependency] { /// Whether swift-syntax is being built as a single dynamic library instead of as a separate library per module. diff --git a/Sources/_InternalTestSupport/SwiftTesting+TraitConditional.swift b/Sources/_InternalTestSupport/SwiftTesting+TraitConditional.swift index a46dfafe162..ba7edf39e6e 100644 --- a/Sources/_InternalTestSupport/SwiftTesting+TraitConditional.swift +++ b/Sources/_InternalTestSupport/SwiftTesting+TraitConditional.swift @@ -85,8 +85,17 @@ extension Trait where Self == Testing.ConditionTrait { // Enabled if the toolchain has supported features public static var supportsSupportedFeatures: Self { - enabled("skipping because test environment compiler doesn't support `-print-supported-features`") { - (try? UserToolchain.default)!.supportsSupportedFeatures + let isEnabled: Bool + let errorInfo: String + do { + isEnabled = try UserToolchain.default.supportsSupportedFeatures + errorInfo = "" + } catch { + isEnabled = false + errorInfo = "Error: \(error)" + } + return enabled("Skipping because test environment compiler doesn't support `-print-supported-features`.\(errorInfo)") { + isEnabled } }