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

Idea: Allow path local dev-dependencies for tests #4466

Closed
carllerche opened this issue Sep 3, 2017 · 2 comments
Closed

Idea: Allow path local dev-dependencies for tests #4466

carllerche opened this issue Sep 3, 2017 · 2 comments

Comments

@carllerche
Copy link
Member

The problem:

Cargo expects tests (in the tests/) directory to be spread out across multiple files which are compiled to individual executables. When tests get more involved, it can be useful to extract "support" code into separate modules that are reused across each test file. However, this support code gets compiled once for each test file (which leads to slow compilation times). Also, all functions that exist in the support modules might not be used in each test file, which results in dead code compiler warnings.

Current work around:

The current work around that I see is to move all support code into a dedicated crate. This crate can be depended on using a local path dependency. The problem w/ this is that when publishing the crate to crates.io, crates.io returns with an error indicating that there is a path dependency in the Cargo.toml that doesn't live on crates.io itself. Indeed, I would rather not publish my test support junk to crates.io....

Possible solution:

Somehow allow path-local dev dependencies to be included when pushed to crates.io. All the support code could be included in the top level crate so that tests can still be run when pulled from crates.io.

@lukaslueg
Copy link
Contributor

Possible dupe of #3745

@carols10cents
Copy link
Member

Yep, closing as duplicate of #3745. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants