Skip to content

Commit 2e0a0ef

Browse files
committed
Tests: Migrate 3 suites to Swift Testing
Migrate a few suites to Swift Teting, namely, - SwiftSDKCommandTests - MultiRootSupportTests - SwiftCommandStateTests Depends on: #9012 Relates to: #8997 issue: rdar://157669245
1 parent d505742 commit 2e0a0ef

File tree

5 files changed

+534
-490
lines changed

5 files changed

+534
-490
lines changed

Sources/_InternalTestSupport/SwiftTesting+Tags.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ extension Tag.Feature.Command {
4141
public enum Package {}
4242
public enum PackageRegistry {}
4343
@Tag public static var Build: Tag
44-
@Tag public static var Test: Tag
4544
@Tag public static var Run: Tag
45+
@Tag public static var Sdk: Tag
46+
@Tag public static var Test: Tag
4647
}
4748

4849
extension Tag.Feature.Command.Package {

Tests/CommandsTests/CommandsTestCase.swift

Lines changed: 0 additions & 54 deletions
This file was deleted.

Tests/CommandsTests/MultiRootSupportTests.swift

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,37 @@
22
//
33
// This source file is part of the Swift open source project
44
//
5-
// Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2014-2025 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
99
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1010
//
1111
//===----------------------------------------------------------------------===//
12+
import Foundation
1213

1314
import Basics
1415
import Commands
1516
import _InternalTestSupport
1617
import Workspace
17-
import XCTest
18+
import Testing
1819

19-
final class MultiRootSupportTests: CommandsTestCase {
20-
func testWorkspaceLoader() throws {
20+
@Suite(
21+
.tags(
22+
.TestSize.large,
23+
),
24+
)
25+
struct MultiRootSupportTests {
26+
@Test
27+
func workspaceLoader() throws {
2128
let fs = InMemoryFileSystem(emptyFiles: [
2229
"/tmp/test/dep/Package.swift",
2330
"/tmp/test/local/Package.swift",
2431
])
2532
let path = AbsolutePath("/tmp/test/Workspace.xcworkspace")
26-
try fs.writeFileContents(path.appending("contents.xcworkspacedata"), string:
33+
try fs.writeFileContents(
34+
path.appending("contents.xcworkspacedata"),
35+
string:
2736
"""
2837
<?xml version="1.0" encoding="UTF-8"?>
2938
<Workspace
@@ -41,7 +50,9 @@ final class MultiRootSupportTests: CommandsTestCase {
4150
let observability = ObservabilitySystem.makeForTesting()
4251
let result = try XcodeWorkspaceLoader(fileSystem: fs, observabilityScope: observability.topScope).load(workspace: path)
4352

44-
XCTAssertNoDiagnostics(observability.diagnostics)
45-
XCTAssertEqual(result.map{ $0.pathString }.sorted(), [AbsolutePath("/tmp/test/dep").pathString, AbsolutePath("/tmp/test/local").pathString])
53+
expectNoDiagnostics(observability.diagnostics)
54+
let actual = result.map { $0.pathString }.sorted()
55+
let expected = [AbsolutePath("/tmp/test/dep").pathString, AbsolutePath("/tmp/test/local").pathString]
56+
#expect(actual == expected)
4657
}
4758
}

0 commit comments

Comments
 (0)