Skip to content

Commit 73cdfc5

Browse files
committed
Revert "Fixup some build warnings in tests (swiftlang#8184)"
This reverts commit dd1f6f4.
1 parent ba273eb commit 73cdfc5

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

Tests/CommandsTests/BuildCommandTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ final class BuildCommandTests: CommandsTestCase {
142142
stderr.contains(
143143
"error: Target A imports another target (B) in the package without declaring it a dependency."
144144
),
145-
"got stdout: \(String(describing: stdout)), stderr: \(String(describing: stderr))"
145+
"got stdout: \(stdout), stderr: \(stderr)"
146146
)
147147
}
148148
}
@@ -159,7 +159,7 @@ final class BuildCommandTests: CommandsTestCase {
159159
stderr.contains(
160160
"warning: Target A imports another target (B) in the package without declaring it a dependency."
161161
),
162-
"got stdout: \(String(describing: stdout)), stderr: \(String(describing: stderr))"
162+
"got stdout: \(stdout), stderr: \(stderr)"
163163
)
164164
}
165165
}

Tests/CommandsTests/PackageCommandTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,27 +2522,27 @@ final class PackageCommandTests: CommandsTestCase {
25222522

25232523
// Overall configuration: debug, plugin build request: debug -> without testability
25242524
try await fixture(name: "Miscellaneous/Plugins/CommandPluginTestStub") { fixturePath in
2525-
await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "debug", "check-testability", "InternalModule", "debug", "true"], packagePath: fixturePath))
2525+
try await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "debug", "check-testability", "InternalModule", "debug", "true"], packagePath: fixturePath))
25262526
}
25272527

25282528
// Overall configuration: debug, plugin build request: release -> without testability
25292529
try await fixture(name: "Miscellaneous/Plugins/CommandPluginTestStub") { fixturePath in
2530-
await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "debug", "check-testability", "InternalModule", "release", "false"], packagePath: fixturePath))
2530+
try await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "debug", "check-testability", "InternalModule", "release", "false"], packagePath: fixturePath))
25312531
}
25322532

25332533
// Overall configuration: release, plugin build request: debug -> with testability
25342534
try await fixture(name: "Miscellaneous/Plugins/CommandPluginTestStub") { fixturePath in
2535-
await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "InternalModule", "debug", "true"], packagePath: fixturePath))
2535+
try await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "InternalModule", "debug", "true"], packagePath: fixturePath))
25362536
}
25372537

25382538
// Overall configuration: release, plugin build request: release -> with testability
25392539
try await fixture(name: "Miscellaneous/Plugins/CommandPluginTestStub") { fixturePath in
2540-
await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "InternalModule", "release", "false"], packagePath: fixturePath))
2540+
try await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "InternalModule", "release", "false"], packagePath: fixturePath))
25412541
}
25422542

25432543
// Overall configuration: release, plugin build request: release including tests -> with testability
25442544
try await fixture(name: "Miscellaneous/Plugins/CommandPluginTestStub") { fixturePath in
2545-
await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "all-with-tests", "release", "true"], packagePath: fixturePath))
2545+
try await XCTAssertAsyncNoThrow(try await SwiftPM.Package.execute(["-c", "release", "check-testability", "all-with-tests", "release", "true"], packagePath: fixturePath))
25462546
}
25472547
}
25482548

Tests/FunctionalTests/TraitTests.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import XCTest
1919
final class TraitTests: XCTestCase {
2020
func testTraits_whenNoFlagPassed() async throws {
2121
try await fixture(name: "Traits") { fixturePath in
22-
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example")
22+
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example")
2323
// We expect no warnings to be produced. Specifically no unused dependency warnings.
2424
// When fixed, GitHub issue #8131 should re-enable the below assert.
2525
// XCTAssertFalse(stderr.contains("warning:"))
@@ -38,7 +38,7 @@ final class TraitTests: XCTestCase {
3838

3939
func testTraits_whenTraitUnification() async throws {
4040
try await fixture(name: "Traits") { fixturePath in
41-
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package9,Package10"])
41+
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package9,Package10"])
4242
// We expect no warnings to be produced. Specifically no unused dependency warnings.
4343
// When fixed, GitHub issue #8131 should re-enable the below assert.
4444
// XCTAssertFalse(stderr.contains("warning:"))
@@ -61,7 +61,7 @@ final class TraitTests: XCTestCase {
6161

6262
func testTraits_whenTraitUnification_whenSecondTraitNotEnabled() async throws {
6363
try await fixture(name: "Traits") { fixturePath in
64-
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package9"])
64+
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package9"])
6565
// We expect no warnings to be produced. Specifically no unused dependency warnings.
6666
// When fixed, GitHub issue #8131 should re-enable the below assert.
6767
// XCTAssertFalse(stderr.contains("warning:"))
@@ -82,7 +82,7 @@ final class TraitTests: XCTestCase {
8282

8383
func testTraits_whenIndividualTraitsEnabled_andDefaultTraits() async throws {
8484
try await fixture(name: "Traits") { fixturePath in
85-
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package5,Package7,BuildCondition3"])
85+
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "default,Package5,Package7,BuildCondition3"])
8686
// We expect no warnings to be produced. Specifically no unused dependency warnings.
8787
// When fixed, GitHub issue #8131 should re-enable the below assert.
8888
// XCTAssertFalse(stderr.contains("warning:"))
@@ -119,7 +119,7 @@ final class TraitTests: XCTestCase {
119119

120120
func testTraits_whenIndividualTraitsEnabled_andDefaultTraitsDisabled() async throws {
121121
try await fixture(name: "Traits") { fixturePath in
122-
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "Package5,Package7"])
122+
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--traits", "Package5,Package7"])
123123
// We expect no warnings to be produced. Specifically no unused dependency warnings.
124124
// When fixed, GitHub issue #8131 should re-enable the below assert.
125125
// XCTAssertFalse(stderr.contains("warning:"))
@@ -137,7 +137,7 @@ final class TraitTests: XCTestCase {
137137

138138
func testTraits_whenAllTraitsEnabled() async throws {
139139
try await fixture(name: "Traits") { fixturePath in
140-
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--enable-all-traits"])
140+
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--enable-all-traits"])
141141
// We expect no warnings to be produced. Specifically no unused dependency warnings.
142142
// GitHub issue #8131
143143
// XCTAssertFalse(stderr.contains("warning:"))
@@ -163,7 +163,7 @@ final class TraitTests: XCTestCase {
163163

164164
func testTraits_whenAllTraitsEnabled_andDefaultTraitsDisabled() async throws {
165165
try await fixture(name: "Traits") { fixturePath in
166-
let (stdout, _) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--enable-all-traits", "--disable-default-traits"])
166+
let (stdout, stderr) = try await executeSwiftRun(fixturePath.appending("Example"), "Example", extraArgs: ["--enable-all-traits", "--disable-default-traits"])
167167
// We expect no warnings to be produced. Specifically no unused dependency warnings.
168168
// GitHub issue #8131
169169
// XCTAssertFalse(stderr.contains("warning:"))

Tests/WorkspaceTests/WorkspaceTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8698,6 +8698,7 @@ final class WorkspaceTests: XCTestCase {
86988698

86998699
let maxConcurrentRequests = 2
87008700
let concurrentRequests = ThreadSafeBox(0)
8701+
let concurrentRequestsLock = NSLock()
87018702

87028703
var configuration = HTTPClient.Configuration()
87038704
configuration.maxConcurrentRequests = maxConcurrentRequests

0 commit comments

Comments
 (0)