-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
"Could not execute process (never executed)" with [lib] harness = false #2305
Comments
Hm yeah I think Continuing to pass |
I'm gonna tag this as |
Also worth documenting, as I don’t see it http://doc.crates.io/manifest.html and found out the hard way (ok, it was easily fixed and not that dramatic): when |
Going to try and tackle this |
@alexcrichton Regarding your comment about passing If I understood it correctly the behaviour should be:
Is that correct? |
Sounds good to me! |
@alexcrichton Thanks |
Unfortunately this is blocked on rust-lang/rust#33670 |
This is unblocked. |
Now that this is fixed upstream, we can actually add a test for this! Closes rust-lang#2305
Fix `harness = false` on `[lib]` sections Now that this is fixed upstream, we can actually add a test for this! Closes #2305
Now that this is fixed upstream, we can actually add a test for this! Closes rust-lang#2305
Fix `harness = false` on `[lib]` sections Now that this is fixed upstream, we can actually add a test for this! Closes #2305
I just got the same puzzling error in intellij-rust, and I think it may be related to shutting down an ongoing build. Running In fixed it by deleting target/ and rebuilding from scratch |
http://doc.crates.io/manifest.html#configuring-a-target suggests that
harness = false
can be used in the[lib]
section ofCargo.toml
. Let’s try it:--test
is indeed not passed, but--crate-type lib
still is so no executable is created.Grepping Cargo’s source shows an example in
tests/test_cargo_test.rs
whereharness = false
is used in[[test]]
, which makes more sense.So:
harness = false
in a[[test]]
section, not[lib]
.harness = false
in[lib]
should probably emit a warning and be otherwise ignored, since it doesn’t work. Or make Cargo emit in error and abort.harness = false
in[[bin]]
, there is no way that I can find to tell whether an executable is being built for testing or not. Maybe pass--cfg test
?The text was updated successfully, but these errors were encountered: