@@ -64,23 +64,25 @@ pub unsafe fn init(argc: int, argv: **u8) { realargs::init(argc, argv) }
6464#[ cfg( target_os = "freebsd" ) ]
6565mod imp {
6666 use cast;
67- use libc;
67+ # [ cfg ( not ( test ) ) ] use libc;
6868 use option:: { Option , Some , None } ;
6969 use iter:: Iterator ;
70- use str;
70+ # [ cfg ( not ( test ) ) ] use str;
7171 use unstable:: finally:: Finally ;
7272 use unstable:: mutex:: { Mutex , MUTEX_INIT } ;
7373 use util;
74- use vec;
74+ # [ cfg ( not ( test ) ) ] use vec;
7575
7676 static mut global_args_ptr: uint = 0 ;
7777 static mut lock: Mutex = MUTEX_INIT ;
7878
79+ #[ cfg( not( test) ) ]
7980 pub unsafe fn init ( argc : int , argv : * * u8 ) {
8081 let args = load_argc_and_argv ( argc, argv) ;
8182 put ( args) ;
8283 }
8384
85+ #[ cfg( not( test) ) ]
8486 pub unsafe fn cleanup ( ) {
8587 rtassert ! ( take( ) . is_some( ) ) ;
8688 lock. destroy ( ) ;
@@ -127,6 +129,7 @@ mod imp {
127129 }
128130
129131 // Copied from `os`.
132+ #[ cfg( not( test) ) ]
130133 unsafe fn load_argc_and_argv ( argc : int , argv : * * u8 ) -> ~[ ~str ] {
131134 vec:: from_fn ( argc as uint , |i| {
132135 str:: raw:: from_c_str ( * ( argv as * * libc:: c_char ) . offset ( i as int ) )
@@ -163,8 +166,8 @@ mod imp {
163166 }
164167}
165168
166- #[ cfg( target_os = "macos" ) ]
167- #[ cfg( target_os = "win32" ) ]
169+ #[ cfg( target_os = "macos" , not ( test ) ) ]
170+ #[ cfg( target_os = "win32" , not ( test ) ) ]
168171mod imp {
169172 use option:: Option ;
170173
0 commit comments