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>(
889889 let exe_path = cx
890890 . files ( )
891891 . 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 ( ) ) ;
893893 cmd. env ( & key, exe_path) ;
894894 }
895895 }
Original file line number Diff line number Diff line change @@ -190,9 +190,10 @@ let version = env!("CARGO_PKG_VERSION");
190190* ` CARGO_BIN_EXE_<name> ` — The absolute path to a binary target's executable.
191191 This is only set when building an [ integration test] or benchmark. This may
192192 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.
196197
197198[ integration test ] : manifest.md#integration-tests
198199[ `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() {
40294029 & r#"
40304030 #[test]
40314031 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>");
40354035 }
40364036 "#
40374037 . replace ( "<FOO_PATH>" , & bin_path ( "foo" ) )
You can’t perform that action at this time.
0 commit comments