-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Use the correct module name for executable targets combined with an executable product with a different name #9480
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // swift-tools-version: 5.5 | ||
| import PackageDescription | ||
|
|
||
| let package = Package( | ||
| name: "TestableExe", | ||
| products: [ | ||
| .executable(name: "testable-exe", targets: ["TestableExe"]) | ||
| ], | ||
| targets: [ | ||
| .executableTarget( | ||
| name: "TestableExe" | ||
| ), | ||
| .testTarget( | ||
| name: "TestableExeTests", | ||
| dependencies: [ | ||
| "TestableExe", | ||
| ] | ||
| ), | ||
| ] | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| public func functionFromTestableExecutable() { | ||
| print("Hello, world") | ||
| } | ||
|
|
||
| functionFromTestableExecutable() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import XCTest | ||
| @testable import TestableExe | ||
|
|
||
| final class TestableExeTests: XCTestCase { | ||
| func testExample() throws { | ||
| functionFromTestableExecutable() | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -317,6 +317,31 @@ struct TestCommandTests { | |
| } | ||
| } | ||
|
|
||
| @Test( | ||
| .IssueWindowsLongPath, | ||
| .tags( | ||
| .Feature.TargetType.Executable, | ||
| ), | ||
| arguments: SupportedBuildSystemOnAllPlatforms, BuildConfiguration.allCases, | ||
| ) | ||
| func testableExecutableWithDifferentlyNamedExecutableProduct( | ||
| buildSystem: BuildSystemProvider.Kind, | ||
| configuration: BuildConfiguration, | ||
| ) async throws { | ||
| try await withKnownIssue(isIntermittent: true) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (blocking): can we add a
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is what IssueWindowsLongPath is for, no? It's marked intermittent so the ongoing work to resolve those issues doesn't trigger "known issue was not recorded" failures |
||
| try await fixture(name: "Miscellaneous/TestableExeWithDifferentProductName") { fixturePath in | ||
| let result = try await execute( | ||
| ["--vv"], | ||
| packagePath: fixturePath, | ||
| configuration: configuration, | ||
| buildSystem: buildSystem, | ||
| ) | ||
| } | ||
| } when: { | ||
| .windows == ProcessInfo.hostOperatingSystem | ||
| } | ||
| } | ||
|
|
||
| @Test( | ||
| .tags( | ||
| .Feature.TargetType.Executable, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: can we add a PIFBuilder Test that will validate we don't regress this behaviour?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's really important in this case that we ensure packages compile instead of just producing valid PIF, which is why I added the full text fixture above. Otherwise we might generate valid PIF which then fails to compile the user's sources.