@@ -154,27 +154,12 @@ fn target_host_arg() {
154
154
rustc_host( )
155
155
) ,
156
156
)
157
- . file (
158
- "src/main.rs" ,
159
- & format ! (
160
- r#"
161
- use std::env;
162
- fn main() {{
163
- assert_eq!(env::consts::ARCH, "{}");
164
- }}
165
- "# ,
166
- cross_compile:: native_arch( )
167
- ) ,
168
- )
157
+ . file ( "src/lib.rs" , r#""# )
169
158
. build ( ) ;
170
159
171
- let target = rustc_host ( ) ;
172
- p. cargo ( & format ! ( "build -v --target {target}" ) ) . run ( ) ;
173
- assert ! ( p. target_bin( target, "foo" ) . is_file( ) ) ;
174
-
175
- if cross_compile_can_run_on_host ( ) {
176
- p. process ( & p. target_bin ( target, "foo" ) ) . run ( ) ;
177
- }
160
+ p. cargo ( "build -v --target host" )
161
+ . with_stderr_contains ( "[RUNNING] `rustc [..] --target [HOST_TARGET] [..]`" )
162
+ . run ( ) ;
178
163
}
179
164
180
165
#[ cargo_test]
@@ -215,27 +200,12 @@ fn target_host_config() {
215
200
rustc_host( )
216
201
) ,
217
202
)
218
- . file (
219
- "src/main.rs" ,
220
- & format ! (
221
- r#"
222
- use std::env;
223
- fn main() {{
224
- assert_eq!(env::consts::ARCH, "{}");
225
- }}
226
- "# ,
227
- cross_compile:: native_arch( )
228
- ) ,
229
- )
203
+ . file ( "src/lib.rs" , r#""# )
230
204
. build ( ) ;
231
205
232
- let target = rustc_host ( ) ;
233
- p. cargo ( "build -v" ) . run ( ) ;
234
- assert ! ( p. target_bin( target, "foo" ) . is_file( ) ) ;
235
-
236
- if cross_compile_can_run_on_host ( ) {
237
- p. process ( & p. target_bin ( target, "foo" ) ) . run ( ) ;
238
- }
206
+ p. cargo ( "build -v" )
207
+ . with_stderr_contains ( "[RUNNING] `rustc [..] --target [HOST_TARGET] [..]`" )
208
+ . run ( ) ;
239
209
}
240
210
241
211
#[ cargo_test]
0 commit comments