From 2074648e55f7a31e96e0836e2ccda4b387911f87 Mon Sep 17 00:00:00 2001 From: Paul LeMarquand Date: Thu, 13 Jun 2024 16:14:47 -0400 Subject: [PATCH] Update tests to only use swift-testing in 6.0 Swift testing recently dropped support for Swift 5.10 in https://github.com/apple/swift-testing/pull/467 Our tests were only runing swift-testing tests in 6.0 and up, but the test project was configured to include it as a dependency with 5.10. Bump this up to 6.0. --- ...kage@swift-5.10.swift => Package@swift-6.0.swift} | 2 +- .../Tests/PackageTests/PackageTests.swift | 2 +- .../testexplorer/TestExplorerIntegration.test.ts | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) rename assets/test/defaultPackage/{Package@swift-5.10.swift => Package@swift-6.0.swift} (97%) diff --git a/assets/test/defaultPackage/Package@swift-5.10.swift b/assets/test/defaultPackage/Package@swift-6.0.swift similarity index 97% rename from assets/test/defaultPackage/Package@swift-5.10.swift rename to assets/test/defaultPackage/Package@swift-6.0.swift index abad23952..6e1996c84 100644 --- a/assets/test/defaultPackage/Package@swift-5.10.swift +++ b/assets/test/defaultPackage/Package@swift-6.0.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.10 +// swift-tools-version:6.0 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription diff --git a/assets/test/defaultPackage/Tests/PackageTests/PackageTests.swift b/assets/test/defaultPackage/Tests/PackageTests/PackageTests.swift index c8b233d94..5b240108c 100644 --- a/assets/test/defaultPackage/Tests/PackageTests/PackageTests.swift +++ b/assets/test/defaultPackage/Tests/PackageTests/PackageTests.swift @@ -24,7 +24,7 @@ final class MixedXCTestSuite: XCTestCase { } } -#if swift(>=5.10) +#if swift(>=6.0) import Testing @Test func topLevelTestPassing() {} diff --git a/test/suite/testexplorer/TestExplorerIntegration.test.ts b/test/suite/testexplorer/TestExplorerIntegration.test.ts index 12495a53b..5b51bf6b1 100644 --- a/test/suite/testexplorer/TestExplorerIntegration.test.ts +++ b/test/suite/testexplorer/TestExplorerIntegration.test.ts @@ -62,6 +62,18 @@ suite("Test Explorer Suite", function () { const testItems = tests.map(test => { const testItem = getTestItem(controller, test); + if (!testItem) { + const testsInController: string[] = []; + controller.items.forEach(item => { + testsInController.push( + `${item.id}: ${item.label} ${item.error ? `(error: ${item.error})` : ""}` + ); + }); + + assert.fail( + `Unable to find ${test} in Test Controller. Items in test controller are: ${testsInController.join(", ")}` + ); + } assert.ok(testItem); return testItem; });