Skip to content

Commit

Permalink
Make ci happy
Browse files Browse the repository at this point in the history
  • Loading branch information
Knight authored and Knight committed Jun 15, 2016
1 parent 98b7286 commit 9763334
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 33 deletions.
3 changes: 2 additions & 1 deletion src/rustup-dist/tests/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use rustup_mock::{MockCommand, MockInstallerBuilder};
use rustup_dist::prefix::InstallPrefix;
use rustup_dist::ErrorKind;
use rustup_dist::errors::Result;
use rustup_dist::dist::{ToolchainDesc, TargetTriple};
use rustup_dist::dist::{ToolchainDesc, TargetTriple, DEFAULT_DIST_SERVER};
use rustup_dist::download::DownloadCfg;
use rustup_dist::Notification;
use rustup_utils::utils;
Expand Down Expand Up @@ -319,6 +319,7 @@ fn setup(edit: Option<&Fn(&str, &mut MockPackage)>,

let work_tempdir = TempDir::new("multirust").unwrap();
let ref temp_cfg = temp::Cfg::new(work_tempdir.path().to_owned(),
DEFAULT_DIST_SERVER,
Box::new(|_| ()));

let ref url = Url::parse(&format!("file://{}", dist_tempdir.path().to_string_lossy())).unwrap();
Expand Down
13 changes: 7 additions & 6 deletions src/rustup-dist/tests/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ extern crate tempdir;
use rustup_dist::component::Components;
use rustup_dist::component::{DirectoryPackage, Package};
use rustup_dist::component::Transaction;
use rustup_dist::dist::DEFAULT_DIST_SERVER;
use rustup_dist::temp;
use rustup_dist::ErrorKind;
use rustup_dist::Notification;
Expand Down Expand Up @@ -109,7 +110,7 @@ fn basic_install() {
let prefix = InstallPrefix::from(instdir.path().to_owned());

let tmpdir = TempDir::new("multirust").unwrap();
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
let notify = |_: Notification| ();
let tx = Transaction::new(prefix.clone(), &tmpcfg, &notify);

Expand Down Expand Up @@ -147,7 +148,7 @@ fn multiple_component_install() {
let prefix = InstallPrefix::from(instdir.path().to_owned());

let tmpdir = TempDir::new("multirust").unwrap();
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
let notify = |_: Notification| ();
let tx = Transaction::new(prefix.clone(), &tmpcfg, &notify);

Expand Down Expand Up @@ -190,7 +191,7 @@ fn uninstall() {
let prefix = InstallPrefix::from(instdir.path().to_owned());

let tmpdir = TempDir::new("multirust").unwrap();
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
let notify = |_: Notification| ();
let tx = Transaction::new(prefix.clone(), &tmpcfg, &notify);

Expand Down Expand Up @@ -242,7 +243,7 @@ fn component_bad_version() {
let prefix = InstallPrefix::from(instdir.path().to_owned());

let tmpdir = TempDir::new("multirust").unwrap();
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
let notify = |_: Notification| ();
let tx = Transaction::new(prefix.clone(), &tmpcfg, &notify);

Expand Down Expand Up @@ -288,7 +289,7 @@ fn unix_permissions() {
let prefix = InstallPrefix::from(instdir.path().to_owned());

let tmpdir = TempDir::new("multirust").unwrap();
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
let notify = |_: Notification| ();
let tx = Transaction::new(prefix.clone(), &tmpcfg, &notify);

Expand Down Expand Up @@ -332,7 +333,7 @@ fn install_to_prefix_that_does_not_exist() {
let prefix = InstallPrefix::from(does_not_exist.clone());

let tmpdir = TempDir::new("multirust").unwrap();
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
let notify = |_: Notification| ();
let tx = Transaction::new(prefix.clone(), &tmpcfg, &notify);

Expand Down
53 changes: 27 additions & 26 deletions src/rustup-dist/tests/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ extern crate tempdir;

use rustup_dist::prefix::InstallPrefix;
use rustup_dist::component::Transaction;
use rustup_dist::dist::DEFAULT_DIST_SERVER;
use rustup_dist::temp;
use rustup_dist::Notification;
use rustup_dist::ErrorKind;
use rustup_utils::utils;
use rustup_utils::raw as utils_raw;
use rustup_dist::ErrorKind;
use tempdir::TempDir;
use std::fs;
use std::io::Write;
Expand All @@ -21,7 +22,7 @@ fn add_file() {

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let notify = |_: Notification| ();
let mut tx = Transaction::new(prefix.clone(), &tmpcfg, &notify);
Expand All @@ -43,7 +44,7 @@ fn add_file_then_rollback() {

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let notify = |_: Notification| ();
let mut tx = Transaction::new(prefix.clone(), &tmpcfg, &notify);
Expand All @@ -59,7 +60,7 @@ fn add_file_that_exists() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -86,7 +87,7 @@ fn copy_file() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -108,7 +109,7 @@ fn copy_file_then_rollback() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -130,7 +131,7 @@ fn copy_file_that_exists() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand Down Expand Up @@ -160,7 +161,7 @@ fn copy_dir() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand Down Expand Up @@ -190,7 +191,7 @@ fn copy_dir_then_rollback() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand Down Expand Up @@ -220,7 +221,7 @@ fn copy_dir_that_exists() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -245,7 +246,7 @@ fn remove_file() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -266,7 +267,7 @@ fn remove_file_then_rollback() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -287,7 +288,7 @@ fn remove_file_that_not_exists() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -310,7 +311,7 @@ fn remove_dir() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -332,7 +333,7 @@ fn remove_dir_then_rollback() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -354,7 +355,7 @@ fn remove_dir_that_not_exists() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -377,7 +378,7 @@ fn write_file() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -399,7 +400,7 @@ fn write_file_then_rollback() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -418,7 +419,7 @@ fn write_file_that_exists() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -445,7 +446,7 @@ fn modify_file_that_not_exists() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -465,7 +466,7 @@ fn modify_file_that_exists() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -485,7 +486,7 @@ fn modify_file_that_not_exists_then_rollback() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -503,7 +504,7 @@ fn modify_file_that_exists_then_rollback() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -526,7 +527,7 @@ fn modify_twice_then_rollback() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand All @@ -549,7 +550,7 @@ fn do_multiple_op_transaction(rollback: bool) {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand Down Expand Up @@ -645,7 +646,7 @@ fn rollback_failure_keeps_going() {
let prefixdir = TempDir::new("multirust").unwrap();
let txdir = TempDir::new("multirust").unwrap();

let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));

let prefix = InstallPrefix::from(prefixdir.path().to_owned());

Expand Down

0 comments on commit 9763334

Please sign in to comment.