@@ -6,7 +6,6 @@ fn configure(cmd: &str, host: &[&str], target: &[&str]) -> Config {
66 let mut config = Config :: parse ( & [ cmd. to_owned ( ) ] ) ;
77 // don't save toolstates
88 config. save_toolstates = None ;
9- config. skip_only_host_steps = false ;
109 config. dry_run = true ;
1110 config. ninja_in_file = false ;
1211 // try to avoid spurious failures in dist where we create/delete each others file
@@ -20,16 +19,8 @@ fn configure(cmd: &str, host: &[&str], target: &[&str]) -> Config {
2019 t ! ( fs:: create_dir_all( & dir) ) ;
2120 config. out = dir;
2221 config. build = TargetSelection :: from_user ( "A" ) ;
23- config. hosts = vec ! [ config. build]
24- . into_iter ( )
25- . chain ( host. iter ( ) . map ( |s| TargetSelection :: from_user ( s) ) )
26- . collect :: < Vec < _ > > ( ) ;
27- config. targets = config
28- . hosts
29- . clone ( )
30- . into_iter ( )
31- . chain ( target. iter ( ) . map ( |s| TargetSelection :: from_user ( s) ) )
32- . collect :: < Vec < _ > > ( ) ;
22+ config. hosts = host. iter ( ) . map ( |s| TargetSelection :: from_user ( s) ) . collect ( ) ;
23+ config. targets = target. iter ( ) . map ( |s| TargetSelection :: from_user ( s) ) . collect ( ) ;
3324 config
3425}
3526
@@ -45,7 +36,7 @@ mod defaults {
4536
4637 #[ test]
4738 fn build_default ( ) {
48- let build = Build :: new ( configure ( "build" , & [ ] , & [ ] ) ) ;
39+ let build = Build :: new ( configure ( "build" , & [ "A" ] , & [ "A" ] ) ) ;
4940 let mut builder = Builder :: new ( & build) ;
5041 builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Build ) , & [ ] ) ;
5142
@@ -73,7 +64,7 @@ mod defaults {
7364
7465 #[ test]
7566 fn build_stage_0 ( ) {
76- let config = Config { stage : 0 , ..configure ( "build" , & [ ] , & [ ] ) } ;
67+ let config = Config { stage : 0 , ..configure ( "build" , & [ "A" ] , & [ "A" ] ) } ;
7768 let build = Build :: new ( config) ;
7869 let mut builder = Builder :: new ( & build) ;
7970 builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Build ) , & [ ] ) ;
@@ -95,7 +86,7 @@ mod defaults {
9586
9687 #[ test]
9788 fn build_cross_compile ( ) {
98- let config = Config { stage : 1 , ..configure ( "build" , & [ "B" ] , & [ "B" ] ) } ;
89+ let config = Config { stage : 1 , ..configure ( "build" , & [ "A" , " B"] , & [ "A" , "B" ] ) } ;
9990 let build = Build :: new ( config) ;
10091 let mut builder = Builder :: new ( & build) ;
10192 builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Build ) , & [ ] ) ;
@@ -143,7 +134,7 @@ mod defaults {
143134
144135 #[ test]
145136 fn doc_default ( ) {
146- let mut config = configure ( "doc" , & [ ] , & [ ] ) ;
137+ let mut config = configure ( "doc" , & [ "A" ] , & [ "A" ] ) ;
147138 config. compiler_docs = true ;
148139 config. cmd = Subcommand :: Doc { paths : Vec :: new ( ) , open : false } ;
149140 let build = Build :: new ( config) ;
@@ -182,7 +173,7 @@ mod dist {
182173
183174 #[ test]
184175 fn dist_baseline ( ) {
185- let build = Build :: new ( configure ( & [ ] , & [ ] ) ) ;
176+ let build = Build :: new ( configure ( & [ "A" ] , & [ "A" ] ) ) ;
186177 let mut builder = Builder :: new ( & build) ;
187178 builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Dist ) , & [ ] ) ;
188179
@@ -208,7 +199,7 @@ mod dist {
208199
209200 #[ test]
210201 fn dist_with_targets ( ) {
211- let build = Build :: new ( configure ( & [ ] , & [ "B" ] ) ) ;
202+ let build = Build :: new ( configure ( & [ "A" ] , & [ "A" , "B" ] ) ) ;
212203 let mut builder = Builder :: new ( & build) ;
213204 builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Dist ) , & [ ] ) ;
214205
@@ -239,7 +230,7 @@ mod dist {
239230
240231 #[ test]
241232 fn dist_with_hosts ( ) {
242- let build = Build :: new ( configure ( & [ "B" ] , & [ ] ) ) ;
233+ let build = Build :: new ( configure ( & [ "A" , " B"] , & [ "A" , "B" ] ) ) ;
243234 let mut builder = Builder :: new ( & build) ;
244235 builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Dist ) , & [ ] ) ;
245236
@@ -285,7 +276,7 @@ mod dist {
285276 fn dist_only_cross_host ( ) {
286277 let a = TargetSelection :: from_user ( "A" ) ;
287278 let b = TargetSelection :: from_user ( "B" ) ;
288- let mut build = Build :: new ( configure ( & [ "B" ] , & [ ] ) ) ;
279+ let mut build = Build :: new ( configure ( & [ "A" , " B"] , & [ "A" , "B" ] ) ) ;
289280 build. config . docs = false ;
290281 build. config . extended = true ;
291282 build. hosts = vec ! [ b] ;
@@ -307,7 +298,7 @@ mod dist {
307298
308299 #[ test]
309300 fn dist_with_targets_and_hosts ( ) {
310- let build = Build :: new ( configure ( & [ "B" ] , & [ "C" ] ) ) ;
301+ let build = Build :: new ( configure ( & [ "A" , " B"] , & [ "A" , "B" , "C" ] ) ) ;
311302 let mut builder = Builder :: new ( & build) ;
312303 builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Dist ) , & [ ] ) ;
313304
@@ -342,40 +333,26 @@ mod dist {
342333 }
343334
344335 #[ test]
345- fn dist_with_target_flag ( ) {
346- let mut config = configure ( & [ "B" ] , & [ "C" ] ) ;
347- config. skip_only_host_steps = true ; // as-if --target=C was passed
336+ fn dist_with_empty_host ( ) {
337+ let config = configure ( & [ ] , & [ "C" ] ) ;
348338 let build = Build :: new ( config) ;
349339 let mut builder = Builder :: new ( & build) ;
350340 builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Dist ) , & [ ] ) ;
351341
352342 let a = TargetSelection :: from_user ( "A" ) ;
353- let b = TargetSelection :: from_user ( "B" ) ;
354343 let c = TargetSelection :: from_user ( "C" ) ;
355344
356- assert_eq ! (
357- first( builder. cache. all:: <dist:: Docs >( ) ) ,
358- & [ dist:: Docs { host: a } , dist:: Docs { host: b } , dist:: Docs { host: c } , ]
359- ) ;
360- assert_eq ! (
361- first( builder. cache. all:: <dist:: Mingw >( ) ) ,
362- & [ dist:: Mingw { host: a } , dist:: Mingw { host: b } , dist:: Mingw { host: c } , ]
363- ) ;
364- assert_eq ! ( first( builder. cache. all:: <dist:: Rustc >( ) ) , & [ ] ) ;
345+ assert_eq ! ( first( builder. cache. all:: <dist:: Docs >( ) ) , & [ dist:: Docs { host: c } , ] ) ;
346+ assert_eq ! ( first( builder. cache. all:: <dist:: Mingw >( ) ) , & [ dist:: Mingw { host: c } , ] ) ;
365347 assert_eq ! (
366348 first( builder. cache. all:: <dist:: Std >( ) ) ,
367- & [
368- dist:: Std { compiler: Compiler { host: a, stage: 1 } , target: a } ,
369- dist:: Std { compiler: Compiler { host: a, stage: 1 } , target: b } ,
370- dist:: Std { compiler: Compiler { host: a, stage: 2 } , target: c } ,
371- ]
349+ & [ dist:: Std { compiler: Compiler { host: a, stage: 2 } , target: c } , ]
372350 ) ;
373- assert_eq ! ( first( builder. cache. all:: <dist:: Src >( ) ) , & [ ] ) ;
374351 }
375352
376353 #[ test]
377354 fn dist_with_same_targets_and_hosts ( ) {
378- let build = Build :: new ( configure ( & [ "B" ] , & [ "B" ] ) ) ;
355+ let build = Build :: new ( configure ( & [ "A" , " B"] , & [ "A" , "B" ] ) ) ;
379356 let mut builder = Builder :: new ( & build) ;
380357 builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Dist ) , & [ ] ) ;
381358
@@ -428,7 +405,7 @@ mod dist {
428405
429406 #[ test]
430407 fn build_all ( ) {
431- let build = Build :: new ( configure ( & [ "B" ] , & [ "C" ] ) ) ;
408+ let build = Build :: new ( configure ( & [ "A" , " B"] , & [ "A" , "B" , "C" ] ) ) ;
432409 let mut builder = Builder :: new ( & build) ;
433410 builder. run_step_descriptions (
434411 & Builder :: get_step_descriptions ( Kind :: Build ) ,
@@ -464,25 +441,20 @@ mod dist {
464441 }
465442
466443 #[ test]
467- fn build_with_target_flag ( ) {
468- let mut config = configure ( & [ "B" ] , & [ "C" ] ) ;
469- config. skip_only_host_steps = true ;
444+ fn build_with_empty_host ( ) {
445+ let config = configure ( & [ ] , & [ "C" ] ) ;
470446 let build = Build :: new ( config) ;
471447 let mut builder = Builder :: new ( & build) ;
472448 builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Build ) , & [ ] ) ;
473449
474450 let a = TargetSelection :: from_user ( "A" ) ;
475- let b = TargetSelection :: from_user ( "B" ) ;
476451 let c = TargetSelection :: from_user ( "C" ) ;
477452
478453 assert_eq ! (
479454 first( builder. cache. all:: <compile:: Std >( ) ) ,
480455 & [
481456 compile:: Std { compiler: Compiler { host: a, stage: 0 } , target: a } ,
482457 compile:: Std { compiler: Compiler { host: a, stage: 1 } , target: a } ,
483- compile:: Std { compiler: Compiler { host: a, stage: 2 } , target: a } ,
484- compile:: Std { compiler: Compiler { host: a, stage: 1 } , target: b } ,
485- compile:: Std { compiler: Compiler { host: a, stage: 2 } , target: b } ,
486458 compile:: Std { compiler: Compiler { host: a, stage: 2 } , target: c } ,
487459 ]
488460 ) ;
@@ -505,7 +477,7 @@ mod dist {
505477
506478 #[ test]
507479 fn test_with_no_doc_stage0 ( ) {
508- let mut config = configure ( & [ ] , & [ ] ) ;
480+ let mut config = configure ( & [ "A" ] , & [ "A" ] ) ;
509481 config. stage = 0 ;
510482 config. cmd = Subcommand :: Test {
511483 paths : vec ! [ "library/std" . into( ) ] ,
@@ -545,7 +517,7 @@ mod dist {
545517
546518 #[ test]
547519 fn test_exclude ( ) {
548- let mut config = configure ( & [ ] , & [ ] ) ;
520+ let mut config = configure ( & [ "A" ] , & [ "A" ] ) ;
549521 config. exclude = vec ! [ "src/tools/tidy" . into( ) ] ;
550522 config. cmd = Subcommand :: Test {
551523 paths : Vec :: new ( ) ,
@@ -572,7 +544,7 @@ mod dist {
572544
573545 #[ test]
574546 fn doc_ci ( ) {
575- let mut config = configure ( & [ ] , & [ ] ) ;
547+ let mut config = configure ( & [ "A" ] , & [ "A" ] ) ;
576548 config. compiler_docs = true ;
577549 config. cmd = Subcommand :: Doc { paths : Vec :: new ( ) , open : false } ;
578550 let build = Build :: new ( config) ;
@@ -601,7 +573,7 @@ mod dist {
601573 #[ test]
602574 fn test_docs ( ) {
603575 // Behavior of `x.py test` doing various documentation tests.
604- let mut config = configure ( & [ ] , & [ ] ) ;
576+ let mut config = configure ( & [ "A" ] , & [ "A" ] ) ;
605577 config. cmd = Subcommand :: Test {
606578 paths : vec ! [ ] ,
607579 test_args : vec ! [ ] ,
0 commit comments