2
2
//
3
3
// This source file is part of the Swift open source project
4
4
//
5
- // Copyright (c) 2014-2023 Apple Inc. and the Swift project authors
5
+ // Copyright (c) 2014-2024 Apple Inc. and the Swift project authors
6
6
// Licensed under Apache License v2.0 with Runtime Library Exception
7
7
//
8
8
// See http://swift.org/LICENSE.txt for license information
@@ -16,7 +16,7 @@ import PackageModel
16
16
import Workspace
17
17
import XCTest
18
18
19
- class InitTests : XCTestCase {
19
+ final class InitTests : XCTestCase {
20
20
21
21
// MARK: TSCBasic package creation for each package type.
22
22
@@ -53,8 +53,10 @@ class InitTests: XCTestCase {
53
53
XCTAssertMatch ( manifestContents, . contains( packageWithNameOnly ( named: name) ) )
54
54
}
55
55
}
56
-
57
- func testInitPackageExecutable( ) throws {
56
+
57
+ func testInitPackageExecutable( ) async throws {
58
+ try await UserToolchain . default. skipUnlessAtLeastSwift6 ( )
59
+
58
60
try testWithTemporaryDirectory { tmpPath in
59
61
let fs = localFileSystem
60
62
let path = tmpPath. appending ( " Foo " )
@@ -98,7 +100,9 @@ class InitTests: XCTestCase {
98
100
}
99
101
}
100
102
101
- func testInitPackageLibraryWithXCTestOnly( ) throws {
103
+ func testInitPackageLibraryWithXCTestOnly( ) async throws {
104
+ try await UserToolchain . default. skipUnlessAtLeastSwift6 ( )
105
+
102
106
try testWithTemporaryDirectory { tmpPath in
103
107
let fs = localFileSystem
104
108
let path = tmpPath. appending ( " Foo " )
@@ -148,7 +152,7 @@ class InitTests: XCTestCase {
148
152
XCTAssertFileExists ( path. appending ( components: " .build " , triple. platformBuildPathComponent, " debug " , " Modules " , " Foo.swiftmodule " ) )
149
153
}
150
154
}
151
-
155
+
152
156
func testInitPackageLibraryWithSwiftTestingOnly( ) throws {
153
157
try testWithTemporaryDirectory { tmpPath in
154
158
let fs = localFileSystem
@@ -235,7 +239,9 @@ class InitTests: XCTestCase {
235
239
}
236
240
}
237
241
238
- func testInitPackageLibraryWithNoTests( ) throws {
242
+ func testInitPackageLibraryWithNoTests( ) async throws {
243
+ try await UserToolchain . default. skipUnlessAtLeastSwift6 ( )
244
+
239
245
try testWithTemporaryDirectory { tmpPath in
240
246
let fs = localFileSystem
241
247
let path = tmpPath. appending ( " Foo " )
@@ -339,8 +345,9 @@ class InitTests: XCTestCase {
339
345
}
340
346
341
347
// MARK: Special case testing
342
-
343
- func testInitPackageNonc99Directory( ) throws {
348
+
349
+ func testInitPackageNonc99Directory( ) async throws {
350
+ try await UserToolchain . default. skipUnlessAtLeastSwift6 ( )
344
351
try withTemporaryDirectory ( removeTreeOnDeinit: true ) { tempDirPath in
345
352
XCTAssertDirectoryExists ( tempDirPath)
346
353
@@ -367,7 +374,9 @@ class InitTests: XCTestCase {
367
374
}
368
375
}
369
376
370
- func testNonC99NameExecutablePackage( ) throws {
377
+ func testNonC99NameExecutablePackage( ) async throws {
378
+ try await UserToolchain . default. skipUnlessAtLeastSwift6 ( )
379
+
371
380
try withTemporaryDirectory ( removeTreeOnDeinit: true ) { tempDirPath in
372
381
XCTAssertDirectoryExists ( tempDirPath)
373
382
0 commit comments