@@ -13,7 +13,7 @@ use super::common;
1313use super :: { install_bins, InstallOpts } ;
1414use crate :: cli:: download_tracker:: DownloadTracker ;
1515use crate :: dist:: dist:: TargetTriple ;
16- use crate :: process:: { self , Process } ;
16+ use crate :: process:: Process ;
1717use crate :: utils:: utils;
1818use crate :: utils:: Notification ;
1919
@@ -712,7 +712,8 @@ mod tests {
712712
713713 use rustup_macros:: unit_test as test;
714714
715- use crate :: process;
715+ #[ cfg( feature = "test" ) ]
716+ use crate :: process:: TestProcess ;
716717 use crate :: test:: with_saved_path;
717718
718719 fn wide ( str : & str ) -> Vec < u16 > {
@@ -753,9 +754,9 @@ mod tests {
753754 #[ test]
754755 fn windows_path_regkey_type ( ) {
755756 // per issue #261, setting PATH should use REG_EXPAND_SZ.
756- let tp = process :: TestProcess :: default ( ) ;
757+ let tp = TestProcess :: default ( ) ;
757758 with_saved_path ( & mut || {
758- process :: with ( tp. clone ( ) . into ( ) , || {
759+ tp. clone ( ) . run ( || {
759760 let root = RegKey :: predef ( HKEY_CURRENT_USER ) ;
760761 let environment = root
761762 . open_subkey_with_flags ( "Environment" , KEY_READ | KEY_WRITE )
@@ -783,9 +784,9 @@ mod tests {
783784 use std:: io;
784785 // during uninstall the PATH key may end up empty; if so we should
785786 // delete it.
786- let tp = process :: TestProcess :: default ( ) ;
787+ let tp = TestProcess :: default ( ) ;
787788 with_saved_path ( & mut || {
788- process :: with ( tp. clone ( ) . into ( ) , || {
789+ tp. clone ( ) . run ( || {
789790 let root = RegKey :: predef ( HKEY_CURRENT_USER ) ;
790791 let environment = root
791792 . open_subkey_with_flags ( "Environment" , KEY_READ | KEY_WRITE )
@@ -818,15 +819,15 @@ mod tests {
818819 #[ test]
819820 fn windows_doesnt_mess_with_a_non_string_path ( ) {
820821 // This writes an error, so we want a sink for it.
821- let tp = process :: TestProcess {
822+ let tp = TestProcess {
822823 vars : [ ( "HOME" . to_string ( ) , "/unused" . to_string ( ) ) ]
823824 . iter ( )
824825 . cloned ( )
825826 . collect ( ) ,
826827 ..Default :: default ( )
827828 } ;
828829 with_saved_path ( & mut || {
829- process :: with ( tp. clone ( ) . into ( ) , || {
830+ tp. clone ( ) . run ( || {
830831 let root = RegKey :: predef ( HKEY_CURRENT_USER ) ;
831832 let environment = root
832833 . open_subkey_with_flags ( "Environment" , KEY_READ | KEY_WRITE )
@@ -853,9 +854,9 @@ mod tests {
853854 #[ test]
854855 fn windows_treat_missing_path_as_empty ( ) {
855856 // during install the PATH key may be missing; treat it as empty
856- let tp = process :: TestProcess :: default ( ) ;
857+ let tp = TestProcess :: default ( ) ;
857858 with_saved_path ( & mut || {
858- process :: with ( tp. clone ( ) . into ( ) , || {
859+ tp. clone ( ) . run ( {
859860 let root = RegKey :: predef ( HKEY_CURRENT_USER ) ;
860861 let environment = root
861862 . open_subkey_with_flags ( "Environment" , KEY_READ | KEY_WRITE )
0 commit comments