@@ -23,22 +23,23 @@ use std::io::process::{Process, ProcessOutput};
2323#[ test]
2424fn test_destroy_once ( ) {
2525 #[ cfg( not( target_os="android" ) ) ]
26- static PROG : & ' static str = "echo" ;
26+ static mut PROG : & ' static str = "echo" ;
27+
2728 #[ cfg( target_os="android" ) ]
28- static PROG : & ' static str = "ls" ; // android don't have echo binary
29+ static mut PROG : & ' static str = "ls" ; // android don't have echo binary
2930
30- let mut p = Process :: new ( PROG , [ ] ) . unwrap ( ) ;
31+ let mut p = unsafe { Process :: new ( PROG , [ ] ) . unwrap ( ) } ;
3132 p. signal_exit ( ) . unwrap ( ) ; // this shouldn't crash (and nor should the destructor)
3233}
3334
3435#[ test]
3536fn test_destroy_twice ( ) {
3637 #[ cfg( not( target_os="android" ) ) ]
37- static PROG : & ' static str = "echo" ;
38+ static mut PROG : & ' static str = "echo" ;
3839 #[ cfg( target_os="android" ) ]
39- static PROG : & ' static str = "ls" ; // android don't have echo binary
40+ static mut PROG : & ' static str = "ls" ; // android don't have echo binary
4041
41- let mut p = match Process :: new ( PROG , [ ] ) {
42+ let mut p = match unsafe { Process :: new ( PROG , [ ] ) } {
4243 Ok ( p) => p,
4344 Err ( e) => fail ! ( "wut: {}" , e) ,
4445 } ;
@@ -49,13 +50,13 @@ fn test_destroy_twice() {
4950fn test_destroy_actually_kills ( force : bool ) {
5051
5152 #[ cfg( unix, not( target_os="android" ) ) ]
52- static BLOCK_COMMAND : & ' static str = "cat" ;
53+ static mut BLOCK_COMMAND : & ' static str = "cat" ;
5354
5455 #[ cfg( unix, target_os="android" ) ]
55- static BLOCK_COMMAND : & ' static str = "/system/bin/cat" ;
56+ static mut BLOCK_COMMAND : & ' static str = "/system/bin/cat" ;
5657
5758 #[ cfg( windows) ]
58- static BLOCK_COMMAND : & ' static str = "cmd" ;
59+ static mut BLOCK_COMMAND : & ' static str = "cmd" ;
5960
6061 #[ cfg( unix, not( target_os="android" ) ) ]
6162 fn process_exists ( pid : libc:: pid_t ) -> bool {
@@ -91,7 +92,7 @@ fn test_destroy_actually_kills(force: bool) {
9192 }
9293
9394 // this process will stay alive indefinitely trying to read from stdin
94- let mut p = Process :: new ( BLOCK_COMMAND , [ ] ) . unwrap ( ) ;
95+ let mut p = unsafe { Process :: new ( BLOCK_COMMAND , [ ] ) . unwrap ( ) } ;
9596
9697 assert ! ( process_exists( p. id( ) ) ) ;
9798
0 commit comments