The --unit-test flag (with no argument) only works in crates with a single target. In crates with multiple targets, the flag results in a several possible targets found error. If a specific target name is passed as an argument to --unit-test, the tool always passes the --bin flag to Cargo, which fails for lib targets.
This PR changes the behavior when an argument is passed to --unit-test to resolve the name to the corresponding target in order to determine whether to pass the --lib or --bin flag to Cargo.
The
--unit-test
flag (with no argument) only works in crates with a single target. In crates with multiple targets, the flag results in aseveral possible targets found
error. If a specific target name is passed as an argument to--unit-test
, the tool always passes the--bin
flag to Cargo, which fails forlib
targets.This PR changes the behavior when an argument is passed to
--unit-test
to resolve the name to the corresponding target in order to determine whether to pass the--lib
or--bin
flag to Cargo.Fixes #211.