Skip to content

Commit 90a61d1

Browse files
author
Jon Gjengset
committed
Run target-applies-to-host tests on stable
1 parent 86376c8 commit 90a61d1

File tree

1 file changed

+25
-41
lines changed

1 file changed

+25
-41
lines changed

tests/testsuite/build_script.rs

Lines changed: 25 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -411,12 +411,10 @@ fn custom_build_env_var_rustc_linker_host_target() {
411411

412412
// no crate type set => linker never called => build succeeds if and
413413
// only if build.rs succeeds, despite linker binary not existing.
414-
if cargo_test_support::is_nightly() {
415-
p.cargo("build -Z target-applies-to-host --target")
416-
.arg(&target)
417-
.masquerade_as_nightly_cargo()
418-
.run();
419-
}
414+
p.cargo("build -Z target-applies-to-host --target")
415+
.arg(&target)
416+
.masquerade_as_nightly_cargo()
417+
.run();
420418
}
421419

422420
#[cargo_test]
@@ -448,13 +446,11 @@ fn custom_build_env_var_rustc_linker_host_target_env() {
448446

449447
// no crate type set => linker never called => build succeeds if and
450448
// only if build.rs succeeds, despite linker binary not existing.
451-
if cargo_test_support::is_nightly() {
452-
p.cargo("build -Z target-applies-to-host --target")
453-
.env("CARGO_TARGET_APPLIES_TO_HOST", "false")
454-
.arg(&target)
455-
.masquerade_as_nightly_cargo()
456-
.run();
457-
}
449+
p.cargo("build -Z target-applies-to-host --target")
450+
.env("CARGO_TARGET_APPLIES_TO_HOST", "false")
451+
.arg(&target)
452+
.masquerade_as_nightly_cargo()
453+
.run();
458454
}
459455

460456
#[cargo_test]
@@ -485,18 +481,16 @@ fn custom_build_invalid_host_config_feature_flag() {
485481
.build();
486482

487483
// build.rs should fail due to -Zhost-config being set without -Ztarget-applies-to-host
488-
if cargo_test_support::is_nightly() {
489-
p.cargo("build -Z host-config --target")
490-
.arg(&target)
491-
.masquerade_as_nightly_cargo()
492-
.with_status(101)
493-
.with_stderr_contains(
494-
"\
484+
p.cargo("build -Z host-config --target")
485+
.arg(&target)
486+
.masquerade_as_nightly_cargo()
487+
.with_status(101)
488+
.with_stderr_contains(
489+
"\
495490
error: the -Zhost-config flag requires the -Ztarget-applies-to-host flag to be set
496491
",
497-
)
498-
.run();
499-
}
492+
)
493+
.run();
500494
}
501495

502496
#[cargo_test]
@@ -530,8 +524,7 @@ fn custom_build_env_var_rustc_linker_host_target_with_bad_host_config() {
530524
.build();
531525

532526
// build.rs should fail due to bad target linker being set
533-
if cargo_test_support::is_nightly() {
534-
p.cargo("build -Z target-applies-to-host -Z host-config --verbose --target")
527+
p.cargo("build -Z target-applies-to-host -Z host-config --verbose --target")
535528
.arg(&target)
536529
.masquerade_as_nightly_cargo()
537530
.with_status(101)
@@ -543,7 +536,6 @@ fn custom_build_env_var_rustc_linker_host_target_with_bad_host_config() {
543536
"
544537
)
545538
.run();
546-
}
547539
}
548540

549541
#[cargo_test]
@@ -576,8 +568,7 @@ fn custom_build_env_var_rustc_linker_bad_host() {
576568
.build();
577569

578570
// build.rs should fail due to bad host linker being set
579-
if cargo_test_support::is_nightly() {
580-
p.cargo("build -Z target-applies-to-host -Z host-config --verbose --target")
571+
p.cargo("build -Z target-applies-to-host -Z host-config --verbose --target")
581572
.arg(&target)
582573
.masquerade_as_nightly_cargo()
583574
.with_status(101)
@@ -589,7 +580,6 @@ fn custom_build_env_var_rustc_linker_bad_host() {
589580
"
590581
)
591582
.run();
592-
}
593583
}
594584

595585
#[cargo_test]
@@ -624,8 +614,7 @@ fn custom_build_env_var_rustc_linker_bad_host_with_arch() {
624614
.build();
625615

626616
// build.rs should fail due to bad host linker being set
627-
if cargo_test_support::is_nightly() {
628-
p.cargo("build -Z target-applies-to-host -Z host-config --verbose --target")
617+
p.cargo("build -Z target-applies-to-host -Z host-config --verbose --target")
629618
.arg(&target)
630619
.masquerade_as_nightly_cargo()
631620
.with_status(101)
@@ -637,7 +626,6 @@ fn custom_build_env_var_rustc_linker_bad_host_with_arch() {
637626
"
638627
)
639628
.run();
640-
}
641629
}
642630

643631
#[cargo_test]
@@ -671,12 +659,10 @@ fn custom_build_env_var_rustc_linker_cross_arch_host() {
671659
.build();
672660

673661
// build.rs should fail due to bad host linker being set
674-
if cargo_test_support::is_nightly() {
675-
p.cargo("build -Z target-applies-to-host -Z host-config --verbose --target")
676-
.arg(&target)
677-
.masquerade_as_nightly_cargo()
678-
.run();
679-
}
662+
p.cargo("build -Z target-applies-to-host -Z host-config --verbose --target")
663+
.arg(&target)
664+
.masquerade_as_nightly_cargo()
665+
.run();
680666
}
681667

682668
#[cargo_test]
@@ -712,8 +698,7 @@ fn custom_build_env_var_rustc_linker_bad_cross_arch_host() {
712698
.build();
713699

714700
// build.rs should fail due to bad host linker being set
715-
if cargo_test_support::is_nightly() {
716-
p.cargo("build -Z target-applies-to-host -Z host-config --verbose --target")
701+
p.cargo("build -Z target-applies-to-host -Z host-config --verbose --target")
717702
.arg(&target)
718703
.masquerade_as_nightly_cargo()
719704
.with_status(101)
@@ -725,7 +710,6 @@ fn custom_build_env_var_rustc_linker_bad_cross_arch_host() {
725710
"
726711
)
727712
.run();
728-
}
729713
}
730714

731715
#[cargo_test]

0 commit comments

Comments
 (0)