Skip to content

Conversation

plemarquand
Copy link
Contributor

Motivation:

When running swift package init --type executable --enable-swift-testing an example test is generated but the test target is not created in the manifest.

Modifications:

Add the missing test target to the manifest when these types are initialized with swift-testing tests. This applies to the tool and executable types.

Result:

Packages are initialized with a test target and running swift test runs the generated test successfully.

Issue: #9149

When running `swift package init --type executable --enable-swift-testing`
an example test is generated but the test target is not created in the
manifest.

This applies to the `tool` and `executable` types.

Add the missing test target to the manifest when these types are
initialized with swift-testing tests.

Issue: swiftlang#9149
@plemarquand
Copy link
Contributor Author

@swift-ci test

1 similar comment
@plemarquand
Copy link
Contributor Author

@swift-ci test

@plemarquand
Copy link
Contributor Author

@swift-ci test windows

"""
} else {
testTarget = ""
}
Copy link
Member

@dschaefer2 dschaefer2 Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is true now, but just checking that we support tests depending on executables with all our supported platforms? I remember Windows being an issue but I think we fixed that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is true, yes

@plemarquand
Copy link
Contributor Author

@swift-ci test windows

1 similar comment
@plemarquand
Copy link
Contributor Author

@swift-ci test windows

@plemarquand plemarquand merged commit b234e08 into swiftlang:main Sep 19, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants