File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -889,7 +889,7 @@ fn build_base_args<'a, 'cfg>(
889
889
let exe_path = cx
890
890
. files ( )
891
891
. bin_link_for_target ( bin_target, unit. kind , cx. bcx ) ?;
892
- let key = format ! ( "CARGO_BIN_EXE_{}" , bin_target. crate_name ( ) . to_uppercase ( ) ) ;
892
+ let key = format ! ( "CARGO_BIN_EXE_{}" , bin_target. name ( ) ) ;
893
893
cmd. env ( & key, exe_path) ;
894
894
}
895
895
}
Original file line number Diff line number Diff line change @@ -190,9 +190,10 @@ let version = env!("CARGO_PKG_VERSION");
190
190
* ` CARGO_BIN_EXE_<name> ` — The absolute path to a binary target's executable.
191
191
This is only set when building an [ integration test] or benchmark. This may
192
192
be used with the [ ` env ` macro] to find the executable to run for testing
193
- purposes. The ` <name> ` is the name of the binary converted to uppercase, and
194
- ` - ` converted to ` _ ` . Binaries are automatically built when the test is
195
- built, unless the binary has required features that are not enabled.
193
+ purposes. The ` <name> ` is the name of the binary target, exactly as-is. For
194
+ example, ` CARGO_BIN_EXE_my-program ` for a binary named ` my-program ` .
195
+ Binaries are automatically built when the test is built, unless the binary
196
+ has required features that are not enabled.
196
197
197
198
[ integration test ] : manifest.md#integration-tests
198
199
[ `env` macro ] : ../../std/macro.env.html
Original file line number Diff line number Diff line change @@ -4029,9 +4029,9 @@ fn bin_env_for_test() {
4029
4029
& r#"
4030
4030
#[test]
4031
4031
fn run_bins() {
4032
- assert_eq!(env!("CARGO_BIN_EXE_FOO "), "<FOO_PATH>");
4033
- assert_eq!(env!("CARGO_BIN_EXE_WITH_DASH "), "<WITH_DASH_PATH>");
4034
- assert_eq!(env!("CARGO_BIN_EXE_GRÜSSEN "), "<GRÜSSEN_PATH>");
4032
+ assert_eq!(env!("CARGO_BIN_EXE_foo "), "<FOO_PATH>");
4033
+ assert_eq!(env!("CARGO_BIN_EXE_with-dash "), "<WITH_DASH_PATH>");
4034
+ assert_eq!(env!("CARGO_BIN_EXE_grüßen "), "<GRÜSSEN_PATH>");
4035
4035
}
4036
4036
"#
4037
4037
. replace ( "<FOO_PATH>" , & bin_path ( "foo" ) )
You can’t perform that action at this time.
0 commit comments