You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: