diff --git a/tests/cli-exact.rs b/tests/cli-exact.rs index 71cb5684b1..f63115b58f 100644 --- a/tests/cli-exact.rs +++ b/tests/cli-exact.rs @@ -45,6 +45,88 @@ info: default toolchain set to 'nightly-{0}' }); } +#[test] +fn update_once_and_check_self_update() { + let test_version = "2.0.0"; + + self_update_setup( + &|config, _| { + expect_ok(config, &["rustup-init", "-y", "--no-modify-path"]); + expect_ok(config, &["rustup", "set", "auto-self-update", "check-only"]); + let current_version = env!("CARGO_PKG_VERSION"); + + expect_ok_ex( + config, + &["rustup", "update", "nightly"], + &format!( + r" + nightly-{} installed - 1.3.0 (hash-nightly-2) + +rustup - Update available : {} -> {} +", + &this_host_triple(), + current_version, + test_version + ), + for_host!( + r"info: syncing channel updates for 'nightly-{0}' +info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2) +info: downloading component 'cargo' +info: downloading component 'rust-docs' +info: downloading component 'rust-std' +info: downloading component 'rustc' +info: installing component 'cargo' +info: using up to 500.0 MiB of RAM to unpack components +info: installing component 'rust-docs' +info: installing component 'rust-std' +info: installing component 'rustc' +" + ), + ); + }, + test_version, + ) +} + +#[test] +fn update_once_and_self_update() { + let test_version = "2.0.0"; + + self_update_setup( + &|config, _| { + expect_ok(config, &["rustup-init", "-y", "--no-modify-path"]); + expect_ok(config, &["rustup", "set", "auto-self-update", "enable"]); + expect_ok_ex( + config, + &["rustup", "update", "nightly"], + for_host!( + r" + nightly-{0} installed - 1.3.0 (hash-nightly-2) + +" + ), + for_host!( + r"info: syncing channel updates for 'nightly-{0}' +info: latest update on 2015-01-02, rust version 1.3.0 (hash-nightly-2) +info: downloading component 'cargo' +info: downloading component 'rust-docs' +info: downloading component 'rust-std' +info: downloading component 'rustc' +info: installing component 'cargo' +info: using up to 500.0 MiB of RAM to unpack components +info: installing component 'rust-docs' +info: installing component 'rust-std' +info: installing component 'rustc' +info: checking for self-updates +info: downloading self-update +" + ), + ); + }, + test_version, + ) +} + #[test] fn update_again() { setup(&|config| { diff --git a/tests/cli-v2.rs b/tests/cli-v2.rs index ce1f15bc12..17231b9328 100644 --- a/tests/cli-v2.rs +++ b/tests/cli-v2.rs @@ -1319,6 +1319,7 @@ fn install_with_component_and_target() { #[test] fn test_warn_if_complete_profile_is_used() { setup(&|config| { + expect_ok(config, &["rustup", "set", "auto-self-update", "enable"]); expect_err( config, &[