Skip to content

Add more swiftbuild tests for functions that require swift run #8375

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tests/CommandsTests/BuildCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ class BuildCommandSwiftBuildTests: BuildCommandTestCases {
}

override func testGetTaskAllowEntitlement() async throws {
throw XCTSkip("SWBINTTODO: Test failed because swiftbuild doesn't output precis codesign commands. Once swift run works with swiftbuild the test can be investigated.")
throw XCTSkip("SWBINTTODO: Test failed because swiftbuild doesn't output the codesign commands that the test expects.")
}

override func testCodeCoverage() async throws {
Expand Down
28 changes: 8 additions & 20 deletions Tests/CommandsTests/RunCommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ class RunCommandTestCase: CommandsBuildProviderTestCase {
XCTAssertMatch(stdout, .contains("sentinel"))

// swift-build-tool output should go to stderr.
XCTAssertMatch(stderr, .regex("Compiling"))
XCTAssertMatch(stderr, .contains("Linking"))
XCTAssertMatch(stderr, .contains("Building for debugging"))
if self.buildSystemProvider == .native {
XCTAssertMatch(stderr, .contains("Linking"))
}
}
}
#endif
Expand All @@ -89,8 +91,10 @@ class RunCommandTestCase: CommandsBuildProviderTestCase {
"""))

// swift-build-tool output should go to stderr.
XCTAssertMatch(stderr, .regex("Compiling"))
XCTAssertMatch(stderr, .contains("Linking"))
XCTAssertMatch(stderr, .contains("Building for debugging"))
if self.buildSystemProvider == .native {
XCTAssertMatch(stderr, .contains("Linking"))
}

await XCTAssertThrowsCommandExecutionError(try await execute(["unknown"], packagePath: fixturePath)) { error in
XCTAssertMatch(error.stderr, .contains("error: no executable product named 'unknown'"))
Expand Down Expand Up @@ -253,20 +257,4 @@ class RunCommandSwiftBuildTests: RunCommandTestCase {
override func testUsage() async throws {
try await super.testUsage()
}

override func testMultipleExecutableAndExplicitExecutable() async throws {
throw XCTSkip("SWBINTTODO: https://github.com/swiftlang/swift-package-manager/issues/8279: Swift run using Swift Build does not output executable content to the terminal")
}

override func testUnknownProductAndArgumentPassing() async throws {
throw XCTSkip("SWBINTTODO: https://github.com/swiftlang/swift-package-manager/issues/8279: Swift run using Swift Build does not output executable content to the terminal")
}

override func testToolsetDebugger() async throws {
throw XCTSkip("SWBINTTODO: Test fixture fails to build")
}

override func testUnreachableExecutable() async throws {
throw XCTSkip("SWBINTTODO: Test fails because of build layout differences.")
}
}