Skip to content

Commit 9763334

Browse files
KnightKnight
authored andcommitted
Make ci happy
1 parent 98b7286 commit 9763334

File tree

3 files changed

+36
-33
lines changed

3 files changed

+36
-33
lines changed

src/rustup-dist/tests/dist.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use rustup_mock::{MockCommand, MockInstallerBuilder};
1717
use rustup_dist::prefix::InstallPrefix;
1818
use rustup_dist::ErrorKind;
1919
use rustup_dist::errors::Result;
20-
use rustup_dist::dist::{ToolchainDesc, TargetTriple};
20+
use rustup_dist::dist::{ToolchainDesc, TargetTriple, DEFAULT_DIST_SERVER};
2121
use rustup_dist::download::DownloadCfg;
2222
use rustup_dist::Notification;
2323
use rustup_utils::utils;
@@ -319,6 +319,7 @@ fn setup(edit: Option<&Fn(&str, &mut MockPackage)>,
319319

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

324325
let ref url = Url::parse(&format!("file://{}", dist_tempdir.path().to_string_lossy())).unwrap();

src/rustup-dist/tests/install.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ extern crate tempdir;
66
use rustup_dist::component::Components;
77
use rustup_dist::component::{DirectoryPackage, Package};
88
use rustup_dist::component::Transaction;
9+
use rustup_dist::dist::DEFAULT_DIST_SERVER;
910
use rustup_dist::temp;
1011
use rustup_dist::ErrorKind;
1112
use rustup_dist::Notification;
@@ -109,7 +110,7 @@ fn basic_install() {
109110
let prefix = InstallPrefix::from(instdir.path().to_owned());
110111

111112
let tmpdir = TempDir::new("multirust").unwrap();
112-
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ()));
113+
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
113114
let notify = |_: Notification| ();
114115
let tx = Transaction::new(prefix.clone(), &tmpcfg, &notify);
115116

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

149150
let tmpdir = TempDir::new("multirust").unwrap();
150-
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ()));
151+
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
151152
let notify = |_: Notification| ();
152153
let tx = Transaction::new(prefix.clone(), &tmpcfg, &notify);
153154

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

192193
let tmpdir = TempDir::new("multirust").unwrap();
193-
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ()));
194+
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
194195
let notify = |_: Notification| ();
195196
let tx = Transaction::new(prefix.clone(), &tmpcfg, &notify);
196197

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

244245
let tmpdir = TempDir::new("multirust").unwrap();
245-
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ()));
246+
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
246247
let notify = |_: Notification| ();
247248
let tx = Transaction::new(prefix.clone(), &tmpcfg, &notify);
248249

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

290291
let tmpdir = TempDir::new("multirust").unwrap();
291-
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ()));
292+
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
292293
let notify = |_: Notification| ();
293294
let tx = Transaction::new(prefix.clone(), &tmpcfg, &notify);
294295

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

334335
let tmpdir = TempDir::new("multirust").unwrap();
335-
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), Box::new(|_| ()));
336+
let tmpcfg = temp::Cfg::new(tmpdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
336337
let notify = |_: Notification| ();
337338
let tx = Transaction::new(prefix.clone(), &tmpcfg, &notify);
338339

src/rustup-dist/tests/transactions.rs

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ extern crate tempdir;
44

55
use rustup_dist::prefix::InstallPrefix;
66
use rustup_dist::component::Transaction;
7+
use rustup_dist::dist::DEFAULT_DIST_SERVER;
78
use rustup_dist::temp;
89
use rustup_dist::Notification;
10+
use rustup_dist::ErrorKind;
911
use rustup_utils::utils;
1012
use rustup_utils::raw as utils_raw;
11-
use rustup_dist::ErrorKind;
1213
use tempdir::TempDir;
1314
use std::fs;
1415
use std::io::Write;
@@ -21,7 +22,7 @@ fn add_file() {
2122

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

24-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
25+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
2526

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

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

46-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
47+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
4748

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

62-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
63+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
6364

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

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

89-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
90+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
9091

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

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

111-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
112+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
112113

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

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

133-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
134+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
134135

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

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

163-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
164+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
164165

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

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

193-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
194+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
194195

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

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

223-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
224+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
224225

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

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

248-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
249+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
249250

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

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

269-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
270+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
270271

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

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

290-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
291+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
291292

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

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

313-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
314+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
314315

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

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

335-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
336+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
336337

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

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

357-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
358+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
358359

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

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

380-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
381+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
381382

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

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

402-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
403+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
403404

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

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

421-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
422+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
422423

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

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

448-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
449+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
449450

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

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

468-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
469+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
469470

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

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

488-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
489+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
489490

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

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

506-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
507+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
507508

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

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

529-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
530+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
530531

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

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

552-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
553+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
553554

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

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

648-
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), Box::new(|_| ()));
649+
let tmpcfg = temp::Cfg::new(txdir.path().to_owned(), DEFAULT_DIST_SERVER, Box::new(|_| ()));
649650

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

0 commit comments

Comments
 (0)