File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -771,6 +771,8 @@ impl Shell {
771771 }
772772 ForkResult :: Parent { child } => {
773773 loop {
774+ // some patterns are only available on linux
775+ #[ allow( unreachable_patterns) ]
774776 match waitpid ( child, Some ( WaitPidFlag :: WNOHANG | WaitPidFlag :: WUNTRACED ) ) ? {
775777 WaitStatus :: Exited ( _, _) => {
776778 // the only way this happened is if there was an error before going
Original file line number Diff line number Diff line change 11use plib:: testing:: { run_test, run_test_with_checker, TestPlan } ;
2+ use std:: path:: Path ;
23use std:: process:: Output ;
34use std:: sync:: atomic:: { AtomicBool , Ordering } ;
45
@@ -11,17 +12,17 @@ fn set_env_vars() {
1112 . is_ok ( )
1213 {
1314 let current_dir = std:: env:: current_dir ( ) . unwrap ( ) ;
14- let base_dir = if current_dir. ends_with ( "sh" ) {
15- current_dir. join ( "tests" )
15+ let read_dir = if current_dir. ends_with ( "sh" ) {
16+ current_dir. join ( "tests/read_dir " )
1617 } else {
17- current_dir. join ( "sh/tests" )
18+ current_dir. join ( "sh/tests/read_dir " )
1819 } ;
19- let read_dir = base_dir. join ( "read_dir" ) ;
20- let write_dir = base_dir. join ( "write_dir" ) ;
20+ std:: env:: set_var ( "TEST_READ_DIR" , read_dir) ;
21+
22+ let write_dir = Path :: new ( concat ! ( env!( "CARGO_TARGET_TMPDIR" ) , "/sh_test_write_dir" ) ) ;
2123 if !write_dir. exists ( ) {
2224 std:: fs:: create_dir ( & write_dir) . expect ( "failed to create write_dir" ) ;
2325 }
24- std:: env:: set_var ( "TEST_READ_DIR" , read_dir) ;
2526 std:: env:: set_var ( "TEST_WRITE_DIR" , write_dir) ;
2627 TEST_VARS_ARE_SET . store ( true , Ordering :: SeqCst ) ;
2728 }
You can’t perform that action at this time.
0 commit comments