Skip to content

Document best practices and considerations when using testing libraries in non-test targets #9291

@stmontgomery

Description

@stmontgomery

This is a request to enhance SwiftPM's documentation regarding the use of testing-only libraries such as Swift Testing or XCTest in non-test targets of a package, for example in plain .target style targets as well as .library products.

Built-in testing libraries like Swift Testing and XCTest are only available for use in certain runtime contexts, and although any target in a SwiftPM package is able to import them, doing so in targets that are linked into “production” targets can cause clients to encounter issues if you’re not careful.

Myself and other code owners of Swift Testing are able to consult further on this documentation if needed.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions