@@ -44,7 +44,7 @@ pub fn setup(f: &dyn Fn(&Config)) {
44
44
}
45
45
46
46
pub fn update_setup ( f : & dyn Fn ( & Config , & Path ) ) {
47
- setup ( & |config| {
47
+ clitools :: setup ( Scenario :: SimpleV2 , & |config| {
48
48
// Create a mock self-update server
49
49
let self_dist_tmp = tempfile:: Builder :: new ( )
50
50
. prefix ( "self_dist" )
@@ -64,7 +64,7 @@ pub fn update_setup(f: &dyn Fn(&Config, &Path)) {
64
64
raw:: append_file ( & dist_exe, "" ) . unwrap ( ) ;
65
65
66
66
let root_url = format ! ( "file://{}" , self_dist. display( ) ) ;
67
- env :: set_var ( "RUSTUP_UPDATE_ROOT" , root_url) ;
67
+ config . rustup_update_root = Some ( root_url) ;
68
68
69
69
f ( config, self_dist) ;
70
70
} ) ;
@@ -355,7 +355,7 @@ info: downloading self-update
355
355
) ;
356
356
357
357
update_setup ( & |config, _| {
358
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
358
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
359
359
expect_ok_ex (
360
360
config,
361
361
& [ "rustup" , "self" , "update" ] ,
@@ -389,7 +389,7 @@ fn update_but_delete_existing_updater_first() {
389
389
. cargodir
390
390
. join ( & format ! ( "bin/rustup-init{}" , EXE_SUFFIX ) ) ;
391
391
392
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
392
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
393
393
394
394
// If it happens to already exist for some reason it
395
395
// should just be deleted.
@@ -404,7 +404,7 @@ fn update_but_delete_existing_updater_first() {
404
404
#[ test]
405
405
fn update_download_404 ( ) {
406
406
update_setup ( & |config, self_dist| {
407
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
407
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
408
408
409
409
let trip = this_host_triple ( ) ;
410
410
let dist_dir = self_dist. join ( & format ! ( "archive/{}/{}" , TEST_VERSION , trip) ) ;
@@ -423,7 +423,7 @@ fn update_download_404() {
423
423
#[ test]
424
424
fn update_bogus_version ( ) {
425
425
update_setup ( & |config, _| {
426
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
426
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
427
427
expect_err (
428
428
config,
429
429
& [ "rustup" , "update" , "1.0.0-alpha" ] ,
@@ -438,7 +438,7 @@ fn update_bogus_version() {
438
438
#[ test]
439
439
fn update_updates_rustup_bin ( ) {
440
440
update_setup ( & |config, _| {
441
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
441
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
442
442
443
443
let bin = config. cargodir . join ( & format ! ( "bin/rustup{}" , EXE_SUFFIX ) ) ;
444
444
let before_hash = calc_hash ( & bin) ;
@@ -464,7 +464,7 @@ fn update_updates_rustup_bin() {
464
464
#[ test]
465
465
fn update_bad_schema ( ) {
466
466
update_setup ( & |config, self_dist| {
467
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
467
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
468
468
output_release_file ( self_dist, "17" , "1.1.1" ) ;
469
469
expect_err (
470
470
config,
@@ -478,7 +478,7 @@ fn update_bad_schema() {
478
478
fn update_no_change ( ) {
479
479
let version = env ! ( "CARGO_PKG_VERSION" ) ;
480
480
update_setup ( & |config, self_dist| {
481
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
481
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
482
482
output_release_file ( self_dist, "1" , version) ;
483
483
expect_ok_ex (
484
484
config,
@@ -496,9 +496,9 @@ fn update_no_change() {
496
496
}
497
497
498
498
#[ test]
499
- fn rustup_self_updates ( ) {
499
+ fn rustup_self_updates_trivial ( ) {
500
500
update_setup ( & |config, _| {
501
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
501
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
502
502
503
503
let bin = config. cargodir . join ( & format ! ( "bin/rustup{}" , EXE_SUFFIX ) ) ;
504
504
let before_hash = calc_hash ( & bin) ;
@@ -514,7 +514,7 @@ fn rustup_self_updates() {
514
514
#[ test]
515
515
fn rustup_self_updates_with_specified_toolchain ( ) {
516
516
update_setup ( & |config, _| {
517
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
517
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
518
518
519
519
let bin = config. cargodir . join ( & format ! ( "bin/rustup{}" , EXE_SUFFIX ) ) ;
520
520
let before_hash = calc_hash ( & bin) ;
@@ -530,7 +530,7 @@ fn rustup_self_updates_with_specified_toolchain() {
530
530
#[ test]
531
531
fn rustup_no_self_update_with_specified_toolchain ( ) {
532
532
update_setup ( & |config, _| {
533
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
533
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
534
534
535
535
let bin = config. cargodir . join ( & format ! ( "bin/rustup{}" , EXE_SUFFIX ) ) ;
536
536
let before_hash = calc_hash ( & bin) ;
@@ -546,7 +546,7 @@ fn rustup_no_self_update_with_specified_toolchain() {
546
546
#[ test]
547
547
fn rustup_self_update_exact ( ) {
548
548
update_setup ( & |config, _| {
549
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
549
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
550
550
551
551
expect_ok_ex (
552
552
config,
@@ -574,7 +574,7 @@ info: cleaning up downloads & tmp directories
574
574
#[ test]
575
575
fn updater_leaves_itself_for_later_deletion ( ) {
576
576
update_setup ( & |config, _| {
577
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
577
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
578
578
expect_ok ( config, & [ "rustup" , "update" , "nightly" ] ) ;
579
579
expect_ok ( config, & [ "rustup" , "self" , "update" ] ) ;
580
580
@@ -588,7 +588,7 @@ fn updater_leaves_itself_for_later_deletion() {
588
588
#[ test]
589
589
fn updater_is_deleted_after_running_rustup ( ) {
590
590
update_setup ( & |config, _| {
591
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
591
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
592
592
expect_ok ( config, & [ "rustup" , "update" , "nightly" ] ) ;
593
593
expect_ok ( config, & [ "rustup" , "self" , "update" ] ) ;
594
594
@@ -604,7 +604,7 @@ fn updater_is_deleted_after_running_rustup() {
604
604
#[ test]
605
605
fn updater_is_deleted_after_running_rustc ( ) {
606
606
update_setup ( & |config, _| {
607
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
607
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
608
608
expect_ok ( config, & [ "rustup" , "default" , "nightly" ] ) ;
609
609
expect_ok ( config, & [ "rustup" , "self" , "update" ] ) ;
610
610
@@ -620,7 +620,7 @@ fn updater_is_deleted_after_running_rustc() {
620
620
#[ test]
621
621
fn rustup_still_works_after_update ( ) {
622
622
update_setup ( & |config, _| {
623
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
623
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
624
624
expect_ok ( config, & [ "rustup" , "default" , "nightly" ] ) ;
625
625
expect_ok ( config, & [ "rustup" , "self" , "update" ] ) ;
626
626
expect_stdout_ok ( config, & [ "rustc" , "--version" ] , "hash-nightly-2" ) ;
@@ -814,7 +814,7 @@ fn rls_proxy_set_up_after_install() {
814
814
fn rls_proxy_set_up_after_update ( ) {
815
815
update_setup ( & |config, _| {
816
816
let rls_path = config. cargodir . join ( format ! ( "bin/rls{}" , EXE_SUFFIX ) ) ;
817
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
817
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
818
818
fs:: remove_file ( & rls_path) . unwrap ( ) ;
819
819
expect_ok ( config, & [ "rustup" , "self" , "update" ] ) ;
820
820
assert ! ( rls_path. exists( ) ) ;
@@ -824,7 +824,7 @@ fn rls_proxy_set_up_after_update() {
824
824
#[ test]
825
825
fn update_does_not_overwrite_rustfmt ( ) {
826
826
update_setup ( & |config, self_dist| {
827
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
827
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
828
828
let version = env ! ( "CARGO_PKG_VERSION" ) ;
829
829
output_release_file ( self_dist, "1" , version) ;
830
830
@@ -866,7 +866,7 @@ fn update_does_not_overwrite_rustfmt() {
866
866
#[ test]
867
867
fn update_installs_clippy_cargo_and ( ) {
868
868
update_setup ( & |config, self_dist| {
869
- expect_ok ( config, & [ "rustup-init" , "-y" ] ) ;
869
+ expect_ok ( config, & [ "rustup-init" , "-y" , "--no-modify-path" ] ) ;
870
870
let version = env ! ( "CARGO_PKG_VERSION" ) ;
871
871
output_release_file ( self_dist, "1" , version) ;
872
872
0 commit comments