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

Ignoring --features with -p parameter when running tests #4407

Closed
aleksuss opened this issue Aug 16, 2017 · 2 comments
Closed

Ignoring --features with -p parameter when running tests #4407

aleksuss opened this issue Aug 16, 2017 · 2 comments
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. A-features Area: features — conditional compilation C-bug Category: bug

Comments

@aleksuss
Copy link

aleksuss commented Aug 16, 2017

I try to tell cargo what feature use when testing package package with command like this:

cargo test --features my_feature -p package --lib

but I get result the same if I run:

cargo test -p package --lib

But if I run tests with command:

cargo test --features my_feature --manifest-path package/Cargo.toml --lib

Everything is ok.

@alexcrichton
Copy link
Member

Thanks for the report! This is something wehre I think that Cargo can at the very least give better error messages. Right now when you specify --features it does it for the "target package" (the one specified by --manifest-path rather than the -p argument.

Surprising behavior for sure! Tough to fix though :(. We should give a better error message regardless

@alexcrichton alexcrichton added the A-diagnostics Area: Error and warning messages generated by Cargo itself. label Aug 16, 2017
@carols10cents carols10cents added A-features Area: features — conditional compilation C-bug Category: bug labels Aug 27, 2017
@ehuss
Copy link
Contributor

ehuss commented Mar 5, 2020

-p foo --features foo_feat when not in the foo directory should produce an error if foo_feat isn't defined in the local directory. It should also produce an error in the root of a virtual workspace.
Closing as there are several other issues tracking selection of features in a worskpace, such as #5364, where we'll hopefully get a better story together.

@ehuss ehuss closed this as completed Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. A-features Area: features — conditional compilation C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

4 participants