Add unique test module scope for arg to 'cargo test' #565
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When rustic-cargo-current-test sees point at a test module's definition (or slightly below, while being above the first test function), then construct an argument for 'cargo test' that will run only that module's tests.
Since most test modules are not uniquely named, this means either prepending the parent module to the current module (e.g. when tests are in 'some_mod.rs', then 'cargo test some_mod::tests'), or if at crate root then using 'lib' or 'main' as the argument (e.g. when tests are in 'lib.rs', then 'cargo test lib').
Handle both module definition styles, either when modules are defined in a like-named file or living in a like-named directory in a file named 'mod.rs'.
This commit is feature complete, but only covers the scenario where tests are defined in the same file as production code.
Partially resolves #561 (1-3).