File tree Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -3870,6 +3870,7 @@ fn doctest_and_registry() {
3870
3870
3871
3871
#[ cargo_test]
3872
3872
fn cargo_test_env ( ) {
3873
+ let rustc_host = rustc_host ( ) ;
3873
3874
let src = format ! (
3874
3875
r#"
3875
3876
#![crate_type = "rlib"]
@@ -3888,12 +3889,16 @@ fn cargo_test_env() {
3888
3889
. file ( "src/lib.rs" , & src)
3889
3890
. build ( ) ;
3890
3891
3891
- let cargo = cargo_exe ( )
3892
- . canonicalize ( )
3893
- . unwrap ( )
3894
- . to_str ( )
3895
- . unwrap ( )
3896
- . replace ( std:: env:: consts:: EXE_SUFFIX , "[EXE]" ) ;
3892
+ let cargo = format ! (
3893
+ "{}[EXE]" ,
3894
+ cargo_exe( )
3895
+ . canonicalize( )
3896
+ . unwrap( )
3897
+ . with_extension( "" )
3898
+ . to_str( )
3899
+ . unwrap( )
3900
+ . replace( rustc_host, "[HOST_TARGET]" )
3901
+ ) ;
3897
3902
p. cargo ( "test --lib -- --nocapture" )
3898
3903
. with_stderr_contains ( cargo)
3899
3904
. with_stdout_data ( str![ [ r#"
@@ -3908,10 +3913,14 @@ test env_test ... ok
3908
3913
. unwrap ( )
3909
3914
. canonicalize ( )
3910
3915
. unwrap ( ) ;
3911
- let stderr_rustc = rustc
3912
- . to_str ( )
3913
- . unwrap ( )
3914
- . replace ( std:: env:: consts:: EXE_SUFFIX , "[EXE]" ) ;
3916
+ let stderr_rustc = format ! (
3917
+ "{}[EXE]" ,
3918
+ rustc
3919
+ . with_extension( "" )
3920
+ . to_str( )
3921
+ . unwrap( )
3922
+ . replace( rustc_host, "[HOST_TARGET]" )
3923
+ ) ;
3915
3924
p. cargo ( "test --lib -- --nocapture" )
3916
3925
// we use rustc since $CARGO is only used if it points to a path that exists
3917
3926
. env ( cargo:: CARGO_ENV , rustc)
You can’t perform that action at this time.
0 commit comments