Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/test/clitools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ use super::{
};
use crate::{
cli::rustup_mode,
process, test as rustup_test,
test::{const_dist_dir, tempdir_in_with_prefix, this_host_tuple},
process,
test::{self as rustup_test, const_dist_dir, tempdir_in_with_prefix, this_host_tuple},
utils,
};
#[cfg(windows)]
Expand Down Expand Up @@ -818,11 +818,6 @@ async fn setup_test_state(test_dist_dir: TempDir) -> (TempDir, Config) {
}
}

let current_exe_path = env::current_exe().unwrap();
let mut built_exe_dir = current_exe_path.parent().unwrap();
if built_exe_dir.ends_with("deps") {
built_exe_dir = built_exe_dir.parent().unwrap();
}
let test_dir = rustup_test::test_dir().unwrap();

let exedir = tempdir_in_with_prefix(&test_dir, "rustup-exe").unwrap();
Expand Down Expand Up @@ -852,7 +847,10 @@ async fn setup_test_state(test_dist_dir: TempDir) -> (TempDir, Config) {
test_registry_id: test_id(),
};

let build_path = built_exe_dir.join(format!("rustup-init{EXE_SUFFIX}"));
let build_path = PathBuf::from(
env::var_os("CARGO_BIN_EXE_rustup-init")
.expect("environment variable `CARGO_BIN_EXE_rustup-init` is not set"),
);

let rustup_path = config.exedir.join(format!("rustup{EXE_SUFFIX}"));
// Used to create dist servers. Perhaps should only link when needed?
Expand Down
Loading