diff --git a/Tests/CommandsTests/BuildCommandTests.swift b/Tests/CommandsTests/BuildCommandTests.swift index 56eec94e650..19f40e94d29 100644 --- a/Tests/CommandsTests/BuildCommandTests.swift +++ b/Tests/CommandsTests/BuildCommandTests.swift @@ -108,6 +108,12 @@ class BuildCommandTestCases: CommandsBuildProviderTestCase { XCTAssertMatch(stdout, .contains("SEE ALSO: swift run, swift package, swift test")) } + func testCommandDoesNotEmitDuplicateSymbols() async throws { + let (stdout, stderr) = try await SwiftPM.Build.execute(["--help"]) + XCTAssertNoMatch(stdout, duplicateSymbolRegex) + XCTAssertNoMatch(stderr, duplicateSymbolRegex) + } + func testVersion() async throws { let stdout = try await execute(["--version"]).stdout XCTAssertMatch(stdout, .regex(#"Swift Package Manager -( \w+ )?\d+.\d+.\d+(-\w+)?"#)) @@ -202,12 +208,15 @@ class BuildCommandTestCases: CommandsBuildProviderTestCase { ) guard buildSystemProvider == .xcode || buildSystemProvider == .swiftbuild else { + // The remainder of this test only applies to XCBuild or Swift Build return } // Print correct path when building with XCBuild or Swift Build - let xcodeDebugOutput = try await execute(["--show-bin-path"], packagePath: fullPath) - .stdout + let xcodeDebugOutput = try await execute( + ["-c", "debug", "--show-bin-path"], + packagePath: fullPath) + .stdout let xcodeReleaseOutput = try await execute( ["-c", "release", "--show-bin-path"], packagePath: fullPath diff --git a/Tests/CommandsTests/PackageCommandTests.swift b/Tests/CommandsTests/PackageCommandTests.swift index d681eb04fec..2b83aae5934 100644 --- a/Tests/CommandsTests/PackageCommandTests.swift +++ b/Tests/CommandsTests/PackageCommandTests.swift @@ -45,7 +45,6 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase { var environment = env ?? [:] // don't ignore local packages when caching environment["SWIFTPM_TESTS_PACKAGECACHE"] = "1" - // return try await self.execute(args, packagePath: packagePath, env: environment) return try await executeSwiftPackage( packagePath, extraArgs: args, @@ -77,6 +76,12 @@ class PackageCommandTestCase: CommandsBuildProviderTestCase { XCTAssertMatch(stdout, .contains("SEE ALSO: swift build, swift run, swift test")) } + func testCommandDoesNotEmitDuplicateSymbols() async throws { + let (stdout, stderr) = try await SwiftPM.Package.execute(["--help"]) + XCTAssertNoMatch(stdout, duplicateSymbolRegex) + XCTAssertNoMatch(stderr, duplicateSymbolRegex) + } + func testVersion() async throws { // This test fails when `--build-system ` is provided, so directly invoke SwiftPM.Package.execute let stdout = try await SwiftPM.Package.execute(["--version"]).stdout