Skip to content
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

AddTarget incorrectly assumes an XCTest dependency. #7478

Closed
grynspan opened this issue Apr 22, 2024 · 0 comments · Fixed by #7481
Closed

AddTarget incorrectly assumes an XCTest dependency. #7478

grynspan opened this issue Apr 22, 2024 · 0 comments · Fixed by #7481
Assignees
Labels
bug command-line interface swift test Changes impacting `swift test` tool

Comments

@grynspan
Copy link
Contributor

The new AddTarget code should not always assume that XCTest is a dependency for a new test target. Rather, behaviour should be configured based on the --enable-xctest/--disable-xctest and --enable-experimental-swift-testing/--disable-experimental-swift-testing flags, with XCTest on and swift-testing off by default. Compare the swift package init command.

@grynspan grynspan added bug swift test Changes impacting `swift test` tool command-line interface labels Apr 22, 2024
DougGregor added a commit to DougGregor/swift-package-manager that referenced this issue Apr 23, 2024
Introduce a command-line argument `--testing-library` to the add-target
command to specify which test library to generate the test for. This
can be 'xctest' (the prior XCTest behavior), 'swift-testing' (to use the
new swift-testing library), or 'none' (for no test library at all).

For the new swift-testing generation, also add the appropriate package
and test target dependency, along with a stub testsuite to start from.

Fixes apple#7478
DougGregor added a commit to DougGregor/swift-package-manager that referenced this issue Apr 23, 2024
Introduce a command-line argument `--testing-library` to the add-target
command to specify which test library to generate the test for. This
can be 'xctest' (the prior XCTest behavior), 'swift-testing' (to use the
new swift-testing library), or 'none' (for no test library at all).

For the new swift-testing generation, also add the appropriate package
and test target dependency, along with a stub testsuite to start from.

Fixes apple#7478
DougGregor added a commit to DougGregor/swift-package-manager that referenced this issue May 8, 2024
Introduce a command-line argument `--testing-library` to the add-target
command to specify which test library to generate the test for. This
can be 'xctest' (the prior XCTest behavior), 'swift-testing' (to use the
new swift-testing library), or 'none' (for no test library at all).

For the new swift-testing generation, also add the appropriate package
and test target dependency, along with a stub testsuite to start from.

Fixes apple#7478
DougGregor added a commit that referenced this issue May 8, 2024
Introduce a command-line argument `--testing-library` to the add-target
command to specify which test library to generate the test for. This
can be 'xctest' (the prior XCTest behavior), 'swift-testing' (to use the
new swift-testing library), or 'none' (for no test library at all).

For the new swift-testing generation, also add the appropriate package
and test target dependency, along with a stub testsuite to start from.

Fixes #7478
DougGregor added a commit to DougGregor/swift-package-manager that referenced this issue May 8, 2024
…#7481)

Introduce a command-line argument `--testing-library` to the add-target
command to specify which test library to generate the test for. This
can be 'xctest' (the prior XCTest behavior), 'swift-testing' (to use the
new swift-testing library), or 'none' (for no test library at all).

For the new swift-testing generation, also add the appropriate package
and test target dependency, along with a stub testsuite to start from.

Fixes apple#7478

(cherry picked from commit a37631a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug command-line interface swift test Changes impacting `swift test` tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants