Closed Earthworn closed 9 months ago
I fixed it. For anyone having the same issue: Just reinstall rust.
Still would be glad if someone could explain what my problem was.
@Earthworn glad you've resolved this. Running cargo test --test example
is the correct way.
When i call
cargo test -p cucumber --test example
it fails instantly with:(error: package cucumber cannot be tested because it requires dev-dependencies and is not a member of the workspace)
This is because it was meant to run from this repo root (after doing git clone https://github.com/cucumber-rs/cucumber
).
I think I should strip that -p cucumber
in the Book, because it definitely confuses newbies, not familiar with Rust tooling. Thanks for pointing that out.
I also tried
cargo test --test example
then it does start to compile but fails with:could not compile quickstart_2 (test "example") due to previous error; 1 warning emitted
Here is an extract of the warning:Warning: .drectve `-exclude-symbols:_ZN4core3ops8function6FnOnce9call_once17h718365105d8c95cbE ' unrecognized Warning: .drectve `-exclude-symbols:"_ZN4core3ptr257drop_in_place$LT$hashbrown..raw..RawTable$LT$$LP$$RF$str$C$$LP$$RP$$RP$$GT$..reserve_rehash$LT$hashbrown..map..make_hasher$LT$$RF$str$C$$LP$$RP$$C$std..collections..hash..map..RandomState$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17he7df083f920ee42dE" ' unrecognized Warning: .drectve `-exclude-symbols:"_ZN4core3ptr26drop_in_place$LT$usize$GT$17h8a0c2301359c414aE" ' unrecognized Warning: .drectve `-exclude-symbols:"_ZN4core3ptr30drop_in_place$LT$$RF$usize$GT$17h5544a261123022e1E" ' unrecognized Warning: .drectve `-exclude-symbols:"_ZN4core3ptr32drop_in_place$LT$$RF$$RF$str$GT$17ha965fb47bd2bf802E" ' unrecognized Warning: .drectve `-exclude-symbols:"_ZN4core3ptr365drop_in_place$LT$hashbrown..raw..RawTable$LT$$LP$$RF$str$C$$LP$$RP$$RP$$GT$..find_or_find_insert_slot$LT$hashbrown..map..equivalent_key$LT$$RF$str$C$$RF$str$C$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$C$hashbrown..map..make_hasher$LT$$RF$str$C$$LP$$RP$$C$std..collections..hash..map..RandomState$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h949f7561e009f6bbE" ' unrecognized Warning: .drectve `-exclude-symbols:"_ZN4core3ptr47drop_in_place$LT$$LP$$RF$str$C$$LP$$RP$$RP$$GT$17hebf4139d97db4920E" ' unrecognized Warning: .drectve `-exclude-symbols:"_ZN4core3ptr52drop_in_place$LT$std..thread..local..AccessError$GT$17hb86a08c2686349d6E" ' unrecognized Warning: .drectve `-exclude-symbols:"_ZN4core3ptr76drop_in_place$LT$$RF$std..collections..hash..set..HashSet$LT$$RF$str$GT$$GT$17h30baf595195e3006E" ' unrecognized Warning: .drectve `-exclude-symbols:"_ZN4core4char7methods22_$LT$impl$u20$char$GT$8len_utf817h15fef8e0022228b2E" ' unrecognized Warning: .drectve `-exclude-symbols:_ZN4core5alloc6layout6Layout5array5inner17h97939f616f56a5faE ' unrecognized Warning: .drectve `-exclude-symbols:"_ZN81_$LT$core..str..iter..Chars$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17ha5040fb0292b72dfE" ' unrecognized Warning: .drectve `-exclude-symbols:_ZN9hashbrown3raw4sse25Group10match_byte17h4eae4788174ea010E ' unrecognized Warning: corrupt .drectve at end of def file Warning: corrupt .drectve at end of def file Warning: corrupt .drectve at end of def file
Regarding this... it's the issue with Rust toolchain on Windows, which I'm not familiar with. This, however, steps out of scope of this repo. I'm glad that "just reboot/reinstall" trick worked for you.
I think I should strip that
-p cucumber
in the Book, because it definitely confuses newbies, not familiar with Rust tooling. Thanks for pointing that out.
Actually, I couldn't find such command anywhere in the Book or in the docs. Could you point where exactly you got it from?
UPD: Oh... it's on the generated images, because they are recorded from running in this repo.
@Earthworn edge Book now contains renewed GIFs (you may need hard reload pages to see them).
Hi, thank you for the clarification. Yeah i m obivousliy a newbie and look for a way to run the test.
Hi, i followed the Quickstart guide and tried to run die example tests. I m on Windows 10 When i call
cargo test -p cucumber --test example
it fails instantly with:(error: package cucumber cannot be tested because it requires dev-dependencies and is not a member of the workspace)
I also triedcargo test --test example
then it does start to compile but fails with:could not compile quickstart_2 (test "example") due to previous error; 1 warning emitted
Here is an extract of the warning:my cargo.toml file is this:
My example.rs in tests is this:
and my file structure is: src main.rs tests features book animal.feature cargo.toml cargo.lock
Not sure whats going on and how to fix. Can someone help me?