@@ -53,6 +53,8 @@ pub struct Config {
5353 pub rustup_update_root : Option < String > ,
5454 /// This is cwd for the test
5555 pub workdir : RefCell < PathBuf > ,
56+ /// This is the test root for keeping stuff together
57+ pub test_root_dir : PathBuf ,
5658}
5759
5860// Describes all the features of the mock dist server.
@@ -221,6 +223,7 @@ pub fn setup_test_state(test_dist_dir: tempfile::TempDir) -> (tempfile::TempDir,
221223 homedir,
222224 rustup_update_root : None ,
223225 workdir : RefCell :: new ( workdir) ,
226+ test_root_dir : test_dir. path ( ) . to_path_buf ( ) ,
224227 } ;
225228
226229 let build_path = exe_dir. join ( format ! ( "rustup-init{EXE_SUFFIX}" ) ) ;
@@ -292,9 +295,10 @@ fn create_local_update_server(self_dist: &Path, exedir: &Path, version: &str) ->
292295pub fn self_update_setup ( f : & dyn Fn ( & mut Config , & Path ) , version : & str ) {
293296 test ( Scenario :: SimpleV2 , & |config| {
294297 // Create a mock self-update server
298+
295299 let self_dist_tmp = tempfile:: Builder :: new ( )
296300 . prefix ( "self_dist" )
297- . tempdir ( )
301+ . tempdir_in ( & config . test_root_dir )
298302 . unwrap ( ) ;
299303 let self_dist = self_dist_tmp. path ( ) ;
300304
0 commit comments