File tree Expand file tree Collapse file tree 1 file changed +0
-31
lines changed
src/tools/execute_command Expand file tree Collapse file tree 1 file changed +0
-31
lines changed Original file line number Diff line number Diff line change @@ -254,34 +254,3 @@ impl ProcessRegistry {
254254 Ok ( ( ) )
255255 }
256256}
257-
258- #[ cfg( test) ]
259- mod tests {
260-
261- #[ tokio:: test]
262- async fn test_process_registry ( ) {
263- let mut registry = super :: ProcessRegistry :: new ( ) ;
264- registry
265- . execute_command ( "npm start" , ".\\ target\\ workspace" )
266- . await
267- . unwrap ( ) ;
268- println ! ( "{}: {}" , registry. counter, registry. processes. len( ) ) ;
269- println ! ( "{:?}" , registry. get_process( 1 ) ) ;
270- for _ in 0 ..5 {
271- tokio:: time:: sleep ( std:: time:: Duration :: from_millis ( 1000 ) ) . await ;
272- registry. poll ( ) ;
273- let ( exit_code, output) = registry. get_process ( 1 ) . unwrap ( ) ;
274- println ! ( "{exit_code:?}, {output}" ) ;
275- if exit_code. is_some ( ) {
276- break ;
277- }
278- }
279- println ! ( "Stop processing" ) ;
280- registry. stop_process ( 1 ) . unwrap ( ) ;
281- tokio:: time:: sleep ( std:: time:: Duration :: from_millis ( 1000 ) ) . await ;
282- registry. poll ( ) ;
283- let ( exit_code, output) = registry. get_process ( 1 ) . unwrap ( ) ;
284- println ! ( "{exit_code:?}, {output}" ) ;
285- println ! ( "end" ) ;
286- }
287- }
You can’t perform that action at this time.
0 commit comments