Skip to content

Commit

Permalink
tests: Refactor initial_install tests
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
  • Loading branch information
kinnison committed Feb 23, 2021
1 parent fa20b49 commit 100f7ca
Showing 1 changed file with 13 additions and 47 deletions.
60 changes: 13 additions & 47 deletions tests/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,33 +573,8 @@ fn setup_from_dist_server(
);
}

#[test]
fn initial_install() {
setup(None, GZOnly, &|url,
toolchain,
prefix,
download_cfg,
temp_cfg| {
update_from_dist(
url,
toolchain,
prefix,
&[],
&[],
download_cfg,
temp_cfg,
false,
)
.unwrap();

assert!(utils::path_exists(&prefix.path().join("bin/rustc")));
assert!(utils::path_exists(&prefix.path().join("lib/libstd.rlib")));
});
}

#[test]
fn initial_install_xz() {
setup(None, AddXZ, &|url,
fn initial_install(comps: Compressions) {
setup(None, comps, &|url,
toolchain,
prefix,
download_cfg,
Expand All @@ -622,27 +597,18 @@ fn initial_install_xz() {
}

#[test]
fn initial_install_zst() {
setup(None, AddZStd, &|url,
toolchain,
prefix,
download_cfg,
temp_cfg| {
update_from_dist(
url,
toolchain,
prefix,
&[],
&[],
download_cfg,
temp_cfg,
false,
)
.unwrap();
fn initial_install_gziponly() {
initial_install(GZOnly);
}

assert!(utils::path_exists(&prefix.path().join("bin/rustc")));
assert!(utils::path_exists(&prefix.path().join("lib/libstd.rlib")));
});
#[test]
fn initial_install_xz() {
initial_install(AddXZ);
}

#[test]
fn initial_install_zst() {
initial_install(AddZStd);
}

#[test]
Expand Down

0 comments on commit 100f7ca

Please sign in to comment.