@@ -53,6 +53,8 @@ pub struct Config {
53
53
pub rustup_update_root : Option < String > ,
54
54
/// This is cwd for the test
55
55
pub workdir : RefCell < PathBuf > ,
56
+ /// This is the test root for keeping stuff together
57
+ pub test_root_dir : PathBuf ,
56
58
}
57
59
58
60
// 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,
221
223
homedir,
222
224
rustup_update_root : None ,
223
225
workdir : RefCell :: new ( workdir) ,
226
+ test_root_dir : test_dir. path ( ) . to_path_buf ( ) ,
224
227
} ;
225
228
226
229
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) ->
292
295
pub fn self_update_setup ( f : & dyn Fn ( & mut Config , & Path ) , version : & str ) {
293
296
test ( Scenario :: SimpleV2 , & |config| {
294
297
// Create a mock self-update server
298
+
295
299
let self_dist_tmp = tempfile:: Builder :: new ( )
296
300
. prefix ( "self_dist" )
297
- . tempdir ( )
301
+ . tempdir_in ( & config . test_root_dir )
298
302
. unwrap ( ) ;
299
303
let self_dist = self_dist_tmp. path ( ) ;
300
304
0 commit comments