@@ -22,7 +22,7 @@ use crate::utils::tests::TestCtx;
22
22
use crate :: utils:: tests:: git:: git_test;
23
23
24
24
pub ( crate ) fn parse ( config : & str ) -> Config {
25
- TestCtx :: new ( ) . config ( "check" ) . config_toml ( config) . create_config ( )
25
+ TestCtx :: new ( ) . config ( "check" ) . with_default_toml_config ( config) . create_config ( )
26
26
}
27
27
28
28
fn get_toml ( file : & Path ) -> Result < TomlConfig , toml:: de:: Error > {
@@ -58,7 +58,7 @@ fn download_ci_llvm() {
58
58
// this doesn't make sense, as we are overriding it later.
59
59
let if_unchanged_config = TestCtx :: new ( )
60
60
. config ( "check" )
61
- . config_toml ( "llvm.download-ci-llvm = \" if-unchanged\" " )
61
+ . with_default_toml_config ( "llvm.download-ci-llvm = \" if-unchanged\" " )
62
62
. create_config ( ) ;
63
63
if if_unchanged_config. llvm_from_ci && if_unchanged_config. is_running_on_ci {
64
64
let has_changes = if_unchanged_config. has_changes_from_upstream ( LLVM_INVALIDATION_PATHS ) ;
@@ -119,8 +119,11 @@ fn override_toml() {
119
119
"--set=target.aarch64-apple-darwin.optimized-compiler-builtins=false" ,
120
120
] ;
121
121
122
- let config =
123
- TestCtx :: new ( ) . config ( "check" ) . config_toml ( config_toml) . args ( & args) . create_config ( ) ;
122
+ let config = TestCtx :: new ( )
123
+ . config ( "check" )
124
+ . with_default_toml_config ( config_toml)
125
+ . args ( & args)
126
+ . create_config ( ) ;
124
127
125
128
assert_eq ! ( config. change_id, Some ( ChangeId :: Id ( 1 ) ) , "setting top-level value" ) ;
126
129
assert_eq ! (
@@ -182,7 +185,7 @@ fn override_toml() {
182
185
fn override_toml_duplicate ( ) {
183
186
TestCtx :: new ( )
184
187
. config ( "check" )
185
- . config_toml ( "change-id = 0" )
188
+ . with_default_toml_config ( "change-id = 0" )
186
189
. arg ( "--set" )
187
190
. arg ( "change-id=1" )
188
191
. arg ( "--set" )
@@ -223,7 +226,10 @@ fn rust_optimize() {
223
226
#[ test]
224
227
#[ should_panic]
225
228
fn invalid_rust_optimize ( ) {
226
- TestCtx :: new ( ) . config ( "check" ) . config_toml ( "rust.optimize = \" a\" " ) . create_config ( ) ;
229
+ TestCtx :: new ( )
230
+ . config ( "check" )
231
+ . with_default_toml_config ( "rust.optimize = \" a\" " )
232
+ . create_config ( ) ;
227
233
}
228
234
229
235
#[ test]
@@ -332,7 +338,7 @@ fn verbose_tests_default_value() {
332
338
fn parse_rust_std_features ( ) {
333
339
let config = TestCtx :: new ( )
334
340
. config ( "check" )
335
- . config_toml ( "rust.std-features = [\" panic-unwind\" , \" backtrace\" ]" )
341
+ . with_default_toml_config ( "rust.std-features = [\" panic-unwind\" , \" backtrace\" ]" )
336
342
. create_config ( ) ;
337
343
let expected_features: BTreeSet < String > =
338
344
[ "panic-unwind" , "backtrace" ] . into_iter ( ) . map ( |s| s. to_string ( ) ) . collect ( ) ;
@@ -341,22 +347,31 @@ fn parse_rust_std_features() {
341
347
342
348
#[ test]
343
349
fn parse_rust_std_features_empty ( ) {
344
- let config =
345
- TestCtx :: new ( ) . config ( "check" ) . config_toml ( "rust.std-features = []" ) . create_config ( ) ;
350
+ let config = TestCtx :: new ( )
351
+ . config ( "check" )
352
+ . with_default_toml_config ( "rust.std-features = []" )
353
+ . create_config ( ) ;
346
354
let expected_features: BTreeSet < String > = BTreeSet :: new ( ) ;
347
355
assert_eq ! ( config. rust_std_features, expected_features) ;
348
356
}
349
357
350
358
#[ test]
351
359
#[ should_panic]
352
360
fn parse_rust_std_features_invalid ( ) {
353
- TestCtx :: new ( ) . config ( "check" ) . config_toml ( "rust.std-features = \" backtrace\" " ) . create_config ( ) ;
361
+ TestCtx :: new ( )
362
+ . config ( "check" )
363
+ . with_default_toml_config ( "rust.std-features = \" backtrace\" " )
364
+ . create_config ( ) ;
354
365
}
355
366
356
367
#[ test]
357
368
fn parse_jobs ( ) {
358
369
assert_eq ! (
359
- TestCtx :: new( ) . config( "check" ) . config_toml( "build.jobs = 1" ) . create_config( ) . jobs,
370
+ TestCtx :: new( )
371
+ . config( "check" )
372
+ . with_default_toml_config( "build.jobs = 1" )
373
+ . create_config( )
374
+ . jobs,
360
375
Some ( 1 )
361
376
) ;
362
377
}
@@ -375,7 +390,7 @@ fn jobs_precedence() {
375
390
let config = TestCtx :: new ( )
376
391
. config ( "check" )
377
392
. args ( & [ "--set=build.jobs=12345" ] )
378
- . config_toml (
393
+ . with_default_toml_config (
379
394
r#"
380
395
[build]
381
396
jobs = 67890
@@ -389,7 +404,7 @@ fn jobs_precedence() {
389
404
let config = TestCtx :: new ( )
390
405
. config ( "check" )
391
406
. args ( & [ "--jobs=123" , "--set=build.jobs=456" ] )
392
- . config_toml (
407
+ . with_default_toml_config (
393
408
r#"
394
409
[build]
395
410
jobs = 789
@@ -418,7 +433,7 @@ fn check_rustc_if_unchanged_paths() {
418
433
fn test_explicit_stage ( ) {
419
434
let config = TestCtx :: new ( )
420
435
. config ( "check" )
421
- . config_toml (
436
+ . with_default_toml_config (
422
437
r#"
423
438
[build]
424
439
test-stage = 1
@@ -439,7 +454,7 @@ fn test_explicit_stage() {
439
454
let config = TestCtx :: new ( )
440
455
. config ( "check" )
441
456
. stage ( 2 )
442
- . config_toml (
457
+ . with_default_toml_config (
443
458
r#"
444
459
[build]
445
460
test-stage = 1
@@ -463,7 +478,7 @@ fn test_exclude() {
463
478
let exclude_path = "compiler" ;
464
479
let config = TestCtx :: new ( )
465
480
. config ( "check" )
466
- . config_toml ( & format ! ( "build.exclude=[\" {}\" ]" , exclude_path) )
481
+ . with_default_toml_config ( & format ! ( "build.exclude=[\" {}\" ]" , exclude_path) )
467
482
. create_config ( ) ;
468
483
469
484
let first_excluded = config
0 commit comments