@@ -13,7 +13,7 @@ use super::common;
13
13
use super :: { install_bins, InstallOpts } ;
14
14
use crate :: cli:: download_tracker:: DownloadTracker ;
15
15
use crate :: dist:: dist:: TargetTriple ;
16
- use crate :: process:: { self , Process } ;
16
+ use crate :: process:: Process ;
17
17
use crate :: utils:: utils;
18
18
use crate :: utils:: Notification ;
19
19
@@ -712,7 +712,8 @@ mod tests {
712
712
713
713
use rustup_macros:: unit_test as test;
714
714
715
- use crate :: process;
715
+ #[ cfg( feature = "test" ) ]
716
+ use crate :: process:: TestProcess ;
716
717
use crate :: test:: with_saved_path;
717
718
718
719
fn wide ( str : & str ) -> Vec < u16 > {
@@ -753,9 +754,9 @@ mod tests {
753
754
#[ test]
754
755
fn windows_path_regkey_type ( ) {
755
756
// per issue #261, setting PATH should use REG_EXPAND_SZ.
756
- let tp = process :: TestProcess :: default ( ) ;
757
+ let tp = TestProcess :: default ( ) ;
757
758
with_saved_path ( & mut || {
758
- process :: with ( tp. clone ( ) . into ( ) , || {
759
+ tp. clone ( ) . run ( || {
759
760
let root = RegKey :: predef ( HKEY_CURRENT_USER ) ;
760
761
let environment = root
761
762
. open_subkey_with_flags ( "Environment" , KEY_READ | KEY_WRITE )
@@ -783,9 +784,9 @@ mod tests {
783
784
use std:: io;
784
785
// during uninstall the PATH key may end up empty; if so we should
785
786
// delete it.
786
- let tp = process :: TestProcess :: default ( ) ;
787
+ let tp = TestProcess :: default ( ) ;
787
788
with_saved_path ( & mut || {
788
- process :: with ( tp. clone ( ) . into ( ) , || {
789
+ tp. clone ( ) . run ( || {
789
790
let root = RegKey :: predef ( HKEY_CURRENT_USER ) ;
790
791
let environment = root
791
792
. open_subkey_with_flags ( "Environment" , KEY_READ | KEY_WRITE )
@@ -818,15 +819,15 @@ mod tests {
818
819
#[ test]
819
820
fn windows_doesnt_mess_with_a_non_string_path ( ) {
820
821
// This writes an error, so we want a sink for it.
821
- let tp = process :: TestProcess {
822
+ let tp = TestProcess {
822
823
vars : [ ( "HOME" . to_string ( ) , "/unused" . to_string ( ) ) ]
823
824
. iter ( )
824
825
. cloned ( )
825
826
. collect ( ) ,
826
827
..Default :: default ( )
827
828
} ;
828
829
with_saved_path ( & mut || {
829
- process :: with ( tp. clone ( ) . into ( ) , || {
830
+ tp. clone ( ) . run ( || {
830
831
let root = RegKey :: predef ( HKEY_CURRENT_USER ) ;
831
832
let environment = root
832
833
. open_subkey_with_flags ( "Environment" , KEY_READ | KEY_WRITE )
@@ -853,9 +854,9 @@ mod tests {
853
854
#[ test]
854
855
fn windows_treat_missing_path_as_empty ( ) {
855
856
// during install the PATH key may be missing; treat it as empty
856
- let tp = process :: TestProcess :: default ( ) ;
857
+ let tp = TestProcess :: default ( ) ;
857
858
with_saved_path ( & mut || {
858
- process :: with ( tp. clone ( ) . into ( ) , || {
859
+ tp. clone ( ) . run ( {
859
860
let root = RegKey :: predef ( HKEY_CURRENT_USER ) ;
860
861
let environment = root
861
862
. open_subkey_with_flags ( "Environment" , KEY_READ | KEY_WRITE )
0 commit comments