@@ -5,6 +5,10 @@ use crate::Flags;
5
5
use crate :: core:: build_steps:: doc:: DocumentationFormat ;
6
6
use crate :: core:: config:: Config ;
7
7
8
+ static TEST_TRIPLE_1 : & str = "i686-unknown-haiku" ;
9
+ static TEST_TRIPLE_2 : & str = "i686-unknown-hurd-gnu" ;
10
+ static TEST_TRIPLE_3 : & str = "i686-unknown-netbsd" ;
11
+
8
12
fn configure ( cmd : & str , host : & [ & str ] , target : & [ & str ] ) -> Config {
9
13
configure_with_args ( & [ cmd. to_owned ( ) ] , host, target)
10
14
}
@@ -37,7 +41,7 @@ fn configure_with_args(cmd: &[String], host: &[&str], target: &[&str]) -> Config
37
41
. join ( & thread:: current ( ) . name ( ) . unwrap_or ( "unknown" ) . replace ( ":" , "-" ) ) ;
38
42
t ! ( fs:: create_dir_all( & dir) ) ;
39
43
config. out = dir;
40
- config. build = TargetSelection :: from_user ( "A-A" ) ;
44
+ config. build = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
41
45
config. hosts = host. iter ( ) . map ( |s| TargetSelection :: from_user ( s) ) . collect ( ) ;
42
46
config. targets = target. iter ( ) . map ( |s| TargetSelection :: from_user ( s) ) . collect ( ) ;
43
47
config
@@ -58,48 +62,28 @@ fn run_build(paths: &[PathBuf], config: Config) -> Cache {
58
62
fn check_cli < const N : usize > ( paths : [ & str ; N ] ) {
59
63
run_build (
60
64
& paths. map ( PathBuf :: from) ,
61
- configure_with_args ( & paths. map ( String :: from) , & [ "A-A" ] , & [ "A-A" ] ) ,
65
+ configure_with_args ( & paths. map ( String :: from) , & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ,
62
66
) ;
63
67
}
64
68
65
69
macro_rules! std {
66
70
( $host: ident => $target: ident, stage = $stage: literal) => {
67
71
compile:: Std :: new(
68
- Compiler {
69
- host: TargetSelection :: from_user( concat!(
70
- stringify!( $host) ,
71
- "-" ,
72
- stringify!( $host)
73
- ) ) ,
74
- stage: $stage,
75
- } ,
76
- TargetSelection :: from_user( concat!( stringify!( $target) , "-" , stringify!( $target) ) ) ,
72
+ Compiler { host: TargetSelection :: from_user( $host) , stage: $stage } ,
73
+ TargetSelection :: from_user( $target) ,
77
74
)
78
75
} ;
79
76
}
80
77
81
78
macro_rules! doc_std {
82
- ( $host: ident => $target: ident, stage = $stage: literal) => { {
83
- doc:: Std :: new(
84
- $stage,
85
- TargetSelection :: from_user( concat!( stringify!( $target) , "-" , stringify!( $target) ) ) ,
86
- DocumentationFormat :: Html ,
87
- )
88
- } } ;
79
+ ( $host: ident => $target: ident, stage = $stage: literal) => { { doc:: Std :: new( $stage, TargetSelection :: from_user( $target) , DocumentationFormat :: Html ) } } ;
89
80
}
90
81
91
82
macro_rules! rustc {
92
83
( $host: ident => $target: ident, stage = $stage: literal) => {
93
84
compile:: Rustc :: new(
94
- Compiler {
95
- host: TargetSelection :: from_user( concat!(
96
- stringify!( $host) ,
97
- "-" ,
98
- stringify!( $host)
99
- ) ) ,
100
- stage: $stage,
101
- } ,
102
- TargetSelection :: from_user( concat!( stringify!( $target) , "-" , stringify!( $target) ) ) ,
85
+ Compiler { host: TargetSelection :: from_user( $host) , stage: $stage } ,
86
+ TargetSelection :: from_user( $target) ,
103
87
)
104
88
} ;
105
89
}
@@ -135,7 +119,7 @@ fn test_intersection() {
135
119
136
120
#[ test]
137
121
fn validate_path_remap ( ) {
138
- let build = Build :: new ( configure ( "test" , & [ "A-A" ] , & [ "A-A" ] ) ) ;
122
+ let build = Build :: new ( configure ( "test" , & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ) ;
139
123
140
124
PATH_REMAP
141
125
. iter ( )
@@ -148,7 +132,7 @@ fn validate_path_remap() {
148
132
149
133
#[ test]
150
134
fn check_missing_paths_for_x_test_tests ( ) {
151
- let build = Build :: new ( configure ( "test" , & [ "A-A" ] , & [ "A-A" ] ) ) ;
135
+ let build = Build :: new ( configure ( "test" , & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ) ;
152
136
153
137
let ( _, tests_remap_paths) =
154
138
PATH_REMAP . iter ( ) . find ( |( target_path, _) | * target_path == "tests" ) . unwrap ( ) ;
@@ -172,7 +156,7 @@ fn check_missing_paths_for_x_test_tests() {
172
156
173
157
#[ test]
174
158
fn test_exclude ( ) {
175
- let mut config = configure ( "test" , & [ "A-A" ] , & [ "A-A" ] ) ;
159
+ let mut config = configure ( "test" , & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ;
176
160
config. skip = vec ! [ "src/tools/tidy" . into( ) ] ;
177
161
let cache = run_build ( & [ ] , config) ;
178
162
@@ -187,7 +171,7 @@ fn test_exclude() {
187
171
fn test_exclude_kind ( ) {
188
172
let path = PathBuf :: from ( "compiler/rustc_data_structures" ) ;
189
173
190
- let mut config = configure ( "test" , & [ "A-A" ] , & [ "A-A" ] ) ;
174
+ let mut config = configure ( "test" , & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ;
191
175
// Ensure our test is valid, and `test::Rustc` would be run without the exclude.
192
176
assert ! ( run_build( & [ ] , config. clone( ) ) . contains:: <test:: CrateLibrustc >( ) ) ;
193
177
// Ensure tests for rustc are not skipped.
@@ -200,16 +184,22 @@ fn test_exclude_kind() {
200
184
/// Ensure that if someone passes both a single crate and `library`, all library crates get built.
201
185
#[ test]
202
186
fn alias_and_path_for_library ( ) {
203
- let mut cache =
204
- run_build ( & [ "library" . into ( ) , "core" . into ( ) ] , configure ( "build" , & [ "A-A" ] , & [ "A-A" ] ) ) ;
187
+ let mut cache = run_build (
188
+ & [ "library" . into ( ) , "core" . into ( ) ] ,
189
+ configure ( "build" , & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ,
190
+ ) ;
205
191
assert_eq ! ( first( cache. all:: <compile:: Std >( ) ) , & [
206
- std!( A => A , stage = 0 ) ,
207
- std!( A => A , stage = 1 )
192
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 ) ,
193
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 1 )
208
194
] ) ;
209
195
210
- let mut cache =
211
- run_build ( & [ "library" . into ( ) , "core" . into ( ) ] , configure ( "doc" , & [ "A-A" ] , & [ "A-A" ] ) ) ;
212
- assert_eq ! ( first( cache. all:: <doc:: Std >( ) ) , & [ doc_std!( A => A , stage = 0 ) ] ) ;
196
+ let mut cache = run_build (
197
+ & [ "library" . into ( ) , "core" . into ( ) ] ,
198
+ configure ( "doc" , & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ,
199
+ ) ;
200
+ assert_eq ! ( first( cache. all:: <doc:: Std >( ) ) , & [
201
+ doc_std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 )
202
+ ] ) ;
213
203
}
214
204
215
205
#[ test]
@@ -248,18 +238,18 @@ fn ci_rustc_if_unchanged_logic() {
248
238
mod defaults {
249
239
use pretty_assertions:: assert_eq;
250
240
251
- use super :: { configure, first, run_build} ;
241
+ use super :: { TEST_TRIPLE_1 , TEST_TRIPLE_2 , configure, first, run_build} ;
252
242
use crate :: Config ;
253
243
use crate :: core:: builder:: * ;
254
244
255
245
#[ test]
256
246
fn build_default ( ) {
257
- let mut cache = run_build ( & [ ] , configure ( "build" , & [ "A-A" ] , & [ "A-A" ] ) ) ;
247
+ let mut cache = run_build ( & [ ] , configure ( "build" , & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ) ;
258
248
259
- let a = TargetSelection :: from_user ( "A-A" ) ;
249
+ let a = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
260
250
assert_eq ! ( first( cache. all:: <compile:: Std >( ) ) , & [
261
- std!( A => A , stage = 0 ) ,
262
- std!( A => A , stage = 1 ) ,
251
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 ) ,
252
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 1 ) ,
263
253
] ) ;
264
254
assert ! ( !cache. all:: <compile:: Assemble >( ) . is_empty( ) ) ;
265
255
// Make sure rustdoc is only built once.
@@ -269,16 +259,20 @@ mod defaults {
269
259
// - this is the compiler it's _linked_ to, not built with.
270
260
& [ tool:: Rustdoc { compiler: Compiler { host: a, stage: 1 } } ] ,
271
261
) ;
272
- assert_eq ! ( first( cache. all:: <compile:: Rustc >( ) ) , & [ rustc!( A => A , stage = 0 ) ] , ) ;
262
+ assert_eq ! ( first( cache. all:: <compile:: Rustc >( ) ) , & [
263
+ rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 )
264
+ ] , ) ;
273
265
}
274
266
275
267
#[ test]
276
268
fn build_stage_0 ( ) {
277
- let config = Config { stage : 0 , ..configure ( "build" , & [ "A-A" ] , & [ "A-A" ] ) } ;
269
+ let config = Config { stage : 0 , ..configure ( "build" , & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) } ;
278
270
let mut cache = run_build ( & [ ] , config) ;
279
271
280
- let a = TargetSelection :: from_user ( "A-A" ) ;
281
- assert_eq ! ( first( cache. all:: <compile:: Std >( ) ) , & [ std!( A => A , stage = 0 ) ] ) ;
272
+ let a = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
273
+ assert_eq ! ( first( cache. all:: <compile:: Std >( ) ) , & [
274
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 )
275
+ ] ) ;
282
276
assert ! ( !cache. all:: <compile:: Assemble >( ) . is_empty( ) ) ;
283
277
assert_eq ! (
284
278
first( cache. all:: <tool:: Rustdoc >( ) ) ,
@@ -291,22 +285,25 @@ mod defaults {
291
285
292
286
#[ test]
293
287
fn build_cross_compile ( ) {
294
- let config = Config { stage : 1 , ..configure ( "build" , & [ "A-A" , "B-B" ] , & [ "A-A" , "B-B" ] ) } ;
288
+ let config = Config {
289
+ stage : 1 ,
290
+ ..configure ( "build" , & [ TEST_TRIPLE_1 , TEST_TRIPLE_2 ] , & [ TEST_TRIPLE_1 , TEST_TRIPLE_2 ] )
291
+ } ;
295
292
let mut cache = run_build ( & [ ] , config) ;
296
293
297
- let a = TargetSelection :: from_user ( "A-A" ) ;
298
- let b = TargetSelection :: from_user ( "B-B" ) ;
294
+ let a = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
295
+ let b = TargetSelection :: from_user ( TEST_TRIPLE_2 ) ;
299
296
300
297
// Ideally, this build wouldn't actually have `target: a`
301
298
// rustdoc/rustcc/std here (the user only requested a host=B build, so
302
299
// there's not really a need for us to build for target A in this case
303
300
// (since we're producing stage 1 libraries/binaries). But currently
304
301
// bootstrap is just a bit buggy here; this should be fixed though.
305
302
assert_eq ! ( first( cache. all:: <compile:: Std >( ) ) , & [
306
- std!( A => A , stage = 0 ) ,
307
- std!( A => A , stage = 1 ) ,
308
- std!( A => B , stage = 0 ) ,
309
- std!( A => B , stage = 1 ) ,
303
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 ) ,
304
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 1 ) ,
305
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_2 , stage = 0 ) ,
306
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_2 , stage = 1 ) ,
310
307
] ) ;
311
308
assert_eq ! ( first( cache. all:: <compile:: Assemble >( ) ) , & [
312
309
compile:: Assemble { target_compiler: Compiler { host: a, stage: 0 } } ,
@@ -318,18 +315,18 @@ mod defaults {
318
315
tool:: Rustdoc { compiler: Compiler { host: b, stage: 1 } } ,
319
316
] , ) ;
320
317
assert_eq ! ( first( cache. all:: <compile:: Rustc >( ) ) , & [
321
- rustc!( A => A , stage = 0 ) ,
322
- rustc!( A => B , stage = 0 ) ,
318
+ rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 ) ,
319
+ rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_2 , stage = 0 ) ,
323
320
] ) ;
324
321
}
325
322
326
323
#[ test]
327
324
fn doc_default ( ) {
328
- let mut config = configure ( "doc" , & [ "A-A" ] , & [ "A-A" ] ) ;
325
+ let mut config = configure ( "doc" , & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ;
329
326
config. compiler_docs = true ;
330
327
config. cmd = Subcommand :: Doc { open : false , json : false } ;
331
328
let mut cache = run_build ( & [ ] , config) ;
332
- let a = TargetSelection :: from_user ( "A-A" ) ;
329
+ let a = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
333
330
334
331
// error_index_generator uses stage 0 to share rustdoc artifacts with the
335
332
// rustdoc tool.
@@ -349,7 +346,7 @@ mod defaults {
349
346
mod dist {
350
347
use pretty_assertions:: assert_eq;
351
348
352
- use super :: { Config , first, run_build} ;
349
+ use super :: { Config , TEST_TRIPLE_1 , TEST_TRIPLE_2 , TEST_TRIPLE_3 , first, run_build} ;
353
350
use crate :: core:: builder:: * ;
354
351
355
352
fn configure ( host : & [ & str ] , target : & [ & str ] ) -> Config {
@@ -358,9 +355,9 @@ mod dist {
358
355
359
356
#[ test]
360
357
fn dist_baseline ( ) {
361
- let mut cache = run_build ( & [ ] , configure ( & [ "A-A" ] , & [ "A-A" ] ) ) ;
358
+ let mut cache = run_build ( & [ ] , configure ( & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ) ;
362
359
363
- let a = TargetSelection :: from_user ( "A-A" ) ;
360
+ let a = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
364
361
365
362
assert_eq ! ( first( cache. all:: <dist:: Docs >( ) ) , & [ dist:: Docs { host: a } , ] ) ;
366
363
assert_eq ! ( first( cache. all:: <dist:: Mingw >( ) ) , & [ dist:: Mingw { host: a } , ] ) ;
@@ -380,10 +377,11 @@ mod dist {
380
377
381
378
#[ test]
382
379
fn dist_with_targets ( ) {
383
- let mut cache = run_build ( & [ ] , configure ( & [ "A-A" ] , & [ "A-A" , "B-B" ] ) ) ;
380
+ let mut cache =
381
+ run_build ( & [ ] , configure ( & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 , TEST_TRIPLE_2 ] ) ) ;
384
382
385
- let a = TargetSelection :: from_user ( "A-A" ) ;
386
- let b = TargetSelection :: from_user ( "B-B" ) ;
383
+ let a = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
384
+ let b = TargetSelection :: from_user ( TEST_TRIPLE_2 ) ;
387
385
388
386
assert_eq ! ( first( cache. all:: <dist:: Docs >( ) ) , & [ dist:: Docs { host: a } , dist:: Docs {
389
387
host: b
@@ -403,10 +401,13 @@ mod dist {
403
401
404
402
#[ test]
405
403
fn dist_with_hosts ( ) {
406
- let mut cache = run_build ( & [ ] , configure ( & [ "A-A" , "B-B" ] , & [ "A-A" , "B-B" ] ) ) ;
404
+ let mut cache = run_build (
405
+ & [ ] ,
406
+ configure ( & [ TEST_TRIPLE_1 , TEST_TRIPLE_2 ] , & [ TEST_TRIPLE_1 , TEST_TRIPLE_2 ] ) ,
407
+ ) ;
407
408
408
- let a = TargetSelection :: from_user ( "A-A" ) ;
409
- let b = TargetSelection :: from_user ( "B-B" ) ;
409
+ let a = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
410
+ let b = TargetSelection :: from_user ( TEST_TRIPLE_2 ) ;
410
411
411
412
assert_eq ! ( first( cache. all:: <dist:: Docs >( ) ) , & [ dist:: Docs { host: a } , dist:: Docs {
412
413
host: b
@@ -423,19 +424,20 @@ mod dist {
423
424
dist:: Std { compiler: Compiler { host: a, stage: 1 } , target: b } ,
424
425
] ) ;
425
426
assert_eq ! ( first( cache. all:: <compile:: Std >( ) ) , & [
426
- std!( A => A , stage = 0 ) ,
427
- std!( A => A , stage = 1 ) ,
428
- std!( A => A , stage = 2 ) ,
429
- std!( A => B , stage = 1 ) ,
430
- std!( A => B , stage = 2 ) ,
427
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 ) ,
428
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 1 ) ,
429
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 2 ) ,
430
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_2 , stage = 1 ) ,
431
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_2 , stage = 2 ) ,
431
432
] , ) ;
432
433
assert_eq ! ( first( cache. all:: <dist:: Src >( ) ) , & [ dist:: Src ] ) ;
433
434
}
434
435
435
436
#[ test]
436
437
fn dist_only_cross_host ( ) {
437
- let b = TargetSelection :: from_user ( "B-B" ) ;
438
- let mut config = configure ( & [ "A-A" , "B-B" ] , & [ "A-A" , "B-B" ] ) ;
438
+ let b = TargetSelection :: from_user ( TEST_TRIPLE_2 ) ;
439
+ let mut config =
440
+ configure ( & [ TEST_TRIPLE_1 , TEST_TRIPLE_2 ] , & [ TEST_TRIPLE_1 , TEST_TRIPLE_2 ] ) ;
439
441
config. docs = false ;
440
442
config. extended = true ;
441
443
config. hosts = vec ! [ b] ;
@@ -445,18 +447,25 @@ mod dist {
445
447
compiler: Compiler { host: b, stage: 2 }
446
448
} , ] ) ;
447
449
assert_eq ! ( first( cache. all:: <compile:: Rustc >( ) ) , & [
448
- rustc!( A => A , stage = 0 ) ,
449
- rustc!( A => B , stage = 1 ) ,
450
+ rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 ) ,
451
+ rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_2 , stage = 1 ) ,
450
452
] ) ;
451
453
}
452
454
453
455
#[ test]
454
456
fn dist_with_targets_and_hosts ( ) {
455
- let mut cache = run_build ( & [ ] , configure ( & [ "A-A" , "B-B" ] , & [ "A-A" , "B-B" , "C-C" ] ) ) ;
457
+ let mut cache = run_build (
458
+ & [ ] ,
459
+ configure ( & [ TEST_TRIPLE_1 , TEST_TRIPLE_2 ] , & [
460
+ TEST_TRIPLE_1 ,
461
+ TEST_TRIPLE_2 ,
462
+ TEST_TRIPLE_3 ,
463
+ ] ) ,
464
+ ) ;
456
465
457
- let a = TargetSelection :: from_user ( "A-A" ) ;
458
- let b = TargetSelection :: from_user ( "B-B" ) ;
459
- let c = TargetSelection :: from_user ( "C-C" ) ;
466
+ let a = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
467
+ let b = TargetSelection :: from_user ( TEST_TRIPLE_2 ) ;
468
+ let c = TargetSelection :: from_user ( TEST_TRIPLE_3 ) ;
460
469
461
470
assert_eq ! ( first( cache. all:: <dist:: Docs >( ) ) , & [
462
471
dist:: Docs { host: a } ,
@@ -482,11 +491,11 @@ mod dist {
482
491
483
492
#[ test]
484
493
fn dist_with_empty_host ( ) {
485
- let config = configure ( & [ ] , & [ "C-C" ] ) ;
494
+ let config = configure ( & [ ] , & [ TEST_TRIPLE_3 ] ) ;
486
495
let mut cache = run_build ( & [ ] , config) ;
487
496
488
- let a = TargetSelection :: from_user ( "A-A" ) ;
489
- let c = TargetSelection :: from_user ( "C-C" ) ;
497
+ let a = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
498
+ let c = TargetSelection :: from_user ( TEST_TRIPLE_3 ) ;
490
499
491
500
assert_eq ! ( first( cache. all:: <dist:: Docs >( ) ) , & [ dist:: Docs { host: c } , ] ) ;
492
501
assert_eq ! ( first( cache. all:: <dist:: Mingw >( ) ) , & [ dist:: Mingw { host: c } , ] ) ;
@@ -498,10 +507,13 @@ mod dist {
498
507
499
508
#[ test]
500
509
fn dist_with_same_targets_and_hosts ( ) {
501
- let mut cache = run_build ( & [ ] , configure ( & [ "A-A" , "B-B" ] , & [ "A-A" , "B-B" ] ) ) ;
510
+ let mut cache = run_build (
511
+ & [ ] ,
512
+ configure ( & [ TEST_TRIPLE_1 , TEST_TRIPLE_2 ] , & [ TEST_TRIPLE_1 , TEST_TRIPLE_2 ] ) ,
513
+ ) ;
502
514
503
- let a = TargetSelection :: from_user ( "A-A" ) ;
504
- let b = TargetSelection :: from_user ( "B-B" ) ;
515
+ let a = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
516
+ let b = TargetSelection :: from_user ( TEST_TRIPLE_2 ) ;
505
517
506
518
assert_eq ! ( first( cache. all:: <dist:: Docs >( ) ) , & [ dist:: Docs { host: a } , dist:: Docs {
507
519
host: b
@@ -519,11 +531,11 @@ mod dist {
519
531
] ) ;
520
532
assert_eq ! ( first( cache. all:: <dist:: Src >( ) ) , & [ dist:: Src ] ) ;
521
533
assert_eq ! ( first( cache. all:: <compile:: Std >( ) ) , & [
522
- std!( A => A , stage = 0 ) ,
523
- std!( A => A , stage = 1 ) ,
524
- std!( A => A , stage = 2 ) ,
525
- std!( A => B , stage = 1 ) ,
526
- std!( A => B , stage = 2 ) ,
534
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 ) ,
535
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 1 ) ,
536
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 2 ) ,
537
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_2 , stage = 1 ) ,
538
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_2 , stage = 2 ) ,
527
539
] ) ;
528
540
assert_eq ! ( first( cache. all:: <compile:: Assemble >( ) ) , & [
529
541
compile:: Assemble { target_compiler: Compiler { host: a, stage: 0 } } ,
@@ -535,76 +547,80 @@ mod dist {
535
547
536
548
#[ test]
537
549
fn build_all ( ) {
538
- let build = Build :: new ( configure ( & [ "A-A" , "B-B" ] , & [ "A-A" , "B-B" , "C-C" ] ) ) ;
550
+ let build = Build :: new ( configure ( & [ TEST_TRIPLE_1 , TEST_TRIPLE_2 ] , & [
551
+ TEST_TRIPLE_1 ,
552
+ TEST_TRIPLE_2 ,
553
+ TEST_TRIPLE_3 ,
554
+ ] ) ) ;
539
555
let mut builder = Builder :: new ( & build) ;
540
556
builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Build ) , & [
541
557
"compiler/rustc" . into ( ) ,
542
558
"library" . into ( ) ,
543
559
] ) ;
544
560
545
561
assert_eq ! ( first( builder. cache. all:: <compile:: Std >( ) ) , & [
546
- std!( A => A , stage = 0 ) ,
547
- std!( A => A , stage = 1 ) ,
548
- std!( A => A , stage = 2 ) ,
549
- std!( A => B , stage = 1 ) ,
550
- std!( A => B , stage = 2 ) ,
551
- std!( A => C , stage = 2 ) ,
562
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 ) ,
563
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 1 ) ,
564
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 2 ) ,
565
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_2 , stage = 1 ) ,
566
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_2 , stage = 2 ) ,
567
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_3 , stage = 2 ) ,
552
568
] ) ;
553
569
assert_eq ! ( builder. cache. all:: <compile:: Assemble >( ) . len( ) , 5 ) ;
554
570
assert_eq ! ( first( builder. cache. all:: <compile:: Rustc >( ) ) , & [
555
- rustc!( A => A , stage = 0 ) ,
556
- rustc!( A => A , stage = 1 ) ,
557
- rustc!( A => A , stage = 2 ) ,
558
- rustc!( A => B , stage = 1 ) ,
559
- rustc!( A => B , stage = 2 ) ,
571
+ rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 ) ,
572
+ rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 1 ) ,
573
+ rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 2 ) ,
574
+ rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_2 , stage = 1 ) ,
575
+ rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_2 , stage = 2 ) ,
560
576
] ) ;
561
577
}
562
578
563
579
#[ test]
564
580
fn llvm_out_behaviour ( ) {
565
- let mut config = configure ( & [ "A-A" ] , & [ "B-B" ] ) ;
581
+ let mut config = configure ( & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_2 ] ) ;
566
582
config. llvm_from_ci = true ;
567
583
let build = Build :: new ( config. clone ( ) ) ;
568
584
569
- let target = TargetSelection :: from_user ( "A-A" ) ;
585
+ let target = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
570
586
assert ! ( build. llvm_out( target) . ends_with( "ci-llvm" ) ) ;
571
- let target = TargetSelection :: from_user ( "B-B" ) ;
587
+ let target = TargetSelection :: from_user ( TEST_TRIPLE_2 ) ;
572
588
assert ! ( build. llvm_out( target) . ends_with( "llvm" ) ) ;
573
589
574
590
config. llvm_from_ci = false ;
575
591
let build = Build :: new ( config. clone ( ) ) ;
576
- let target = TargetSelection :: from_user ( "A-A" ) ;
592
+ let target = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
577
593
assert ! ( build. llvm_out( target) . ends_with( "llvm" ) ) ;
578
594
}
579
595
580
596
#[ test]
581
597
fn build_with_empty_host ( ) {
582
- let config = configure ( & [ ] , & [ "C-C" ] ) ;
598
+ let config = configure ( & [ ] , & [ TEST_TRIPLE_3 ] ) ;
583
599
let build = Build :: new ( config) ;
584
600
let mut builder = Builder :: new ( & build) ;
585
601
builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Build ) , & [ ] ) ;
586
602
587
- let a = TargetSelection :: from_user ( "A-A" ) ;
603
+ let a = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
588
604
589
605
assert_eq ! ( first( builder. cache. all:: <compile:: Std >( ) ) , & [
590
- std!( A => A , stage = 0 ) ,
591
- std!( A => A , stage = 1 ) ,
592
- std!( A => C , stage = 2 ) ,
606
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 ) ,
607
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 1 ) ,
608
+ std!( TEST_TRIPLE_1 => TEST_TRIPLE_3 , stage = 2 ) ,
593
609
] ) ;
594
610
assert_eq ! ( first( builder. cache. all:: <compile:: Assemble >( ) ) , & [
595
611
compile:: Assemble { target_compiler: Compiler { host: a, stage: 0 } } ,
596
612
compile:: Assemble { target_compiler: Compiler { host: a, stage: 1 } } ,
597
613
compile:: Assemble { target_compiler: Compiler { host: a, stage: 2 } } ,
598
614
] ) ;
599
615
assert_eq ! ( first( builder. cache. all:: <compile:: Rustc >( ) ) , & [
600
- rustc!( A => A , stage = 0 ) ,
601
- rustc!( A => A , stage = 1 ) ,
616
+ rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 0 ) ,
617
+ rustc!( TEST_TRIPLE_1 => TEST_TRIPLE_1 , stage = 1 ) ,
602
618
] ) ;
603
619
}
604
620
605
621
#[ test]
606
622
fn test_with_no_doc_stage0 ( ) {
607
- let mut config = configure ( & [ "A-A" ] , & [ "A-A" ] ) ;
623
+ let mut config = configure ( & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ;
608
624
config. stage = 0 ;
609
625
config. paths = vec ! [ "library/std" . into( ) ] ;
610
626
config. cmd = Subcommand :: Test {
@@ -626,7 +642,7 @@ mod dist {
626
642
let build = Build :: new ( config) ;
627
643
let mut builder = Builder :: new ( & build) ;
628
644
629
- let host = TargetSelection :: from_user ( "A-A" ) ;
645
+ let host = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
630
646
631
647
builder. run_step_descriptions ( & [ StepDescription :: from :: < test:: Crate > ( Kind :: Test ) ] , & [
632
648
"library/std" . into ( ) ,
@@ -644,13 +660,13 @@ mod dist {
644
660
645
661
#[ test]
646
662
fn doc_ci ( ) {
647
- let mut config = configure ( & [ "A-A" ] , & [ "A-A" ] ) ;
663
+ let mut config = configure ( & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ;
648
664
config. compiler_docs = true ;
649
665
config. cmd = Subcommand :: Doc { open : false , json : false } ;
650
666
let build = Build :: new ( config) ;
651
667
let mut builder = Builder :: new ( & build) ;
652
668
builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Doc ) , & [ ] ) ;
653
- let a = TargetSelection :: from_user ( "A-A" ) ;
669
+ let a = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
654
670
655
671
// error_index_generator uses stage 1 to share rustdoc artifacts with the
656
672
// rustdoc tool.
@@ -671,7 +687,7 @@ mod dist {
671
687
#[ test]
672
688
fn test_docs ( ) {
673
689
// Behavior of `x.py test` doing various documentation tests.
674
- let mut config = configure ( & [ "A-A" ] , & [ "A-A" ] ) ;
690
+ let mut config = configure ( & [ TEST_TRIPLE_1 ] , & [ TEST_TRIPLE_1 ] ) ;
675
691
config. cmd = Subcommand :: Test {
676
692
test_args : vec ! [ ] ,
677
693
compiletest_rustc_args : vec ! [ ] ,
@@ -693,7 +709,7 @@ mod dist {
693
709
let mut builder = Builder :: new ( & build) ;
694
710
695
711
builder. run_step_descriptions ( & Builder :: get_step_descriptions ( Kind :: Test ) , & [ ] ) ;
696
- let a = TargetSelection :: from_user ( "A-A" ) ;
712
+ let a = TargetSelection :: from_user ( TEST_TRIPLE_1 ) ;
697
713
698
714
// error_index_generator uses stage 1 to share rustdoc artifacts with the
699
715
// rustdoc tool.
0 commit comments