Lines Matching defs:err_exit

20 function err_exit
26 alias err_exit='err_exit $LINENO'
31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
34 cd $tmp || err_exit "cd $tmp failed"
47 (( $? == 0)) || err_exit "SIGPIPE with wrong error code $?"
48 [[ $(<out2) == $'PIPED\nPIPED' ]] || err_exit 'SIGPIPE output on standard error is not correct'
55 else err_exit "pipe with --pipefail PIPE trap hangs"
65 done) == 01got_child23 ]] || err_exit 'SIGCHLD not working'
252 do [[ $out == ${expected[$ops]} ]] || err_exit "interrupt $ops test failed -- expected '${expected[$ops]}', got '$out'"
256 [[ $($SHELL -c 'trap "print SIGUSR1 ; exit 0" USR1; (trap "" USR1 ; exec kill -USR1 $$ & sleep 5); print done') == SIGUSR1 ]] || err_exit 'subshell ignoring signal does not send signal to parent'
257 (( (SECONDS-s) < 4 )) && err_exit 'parent does not wait for child to complete before handling signal'
259 [[ $($SHELL -c 'trap "print SIGUSR1 ; exit 0" USR1; (trap "exit" USR1 ; exec kill -USR1 $$ & sleep 5); print done') == SIGUSR1 ]] || err_exit 'subshell catching signal does not send signal to parent'
260 (( SECONDS-s < 4 )) && err_exit 'parent completes early'
265 then err_exit "'kill -l $s' failed"
269 then err_exit "'kill -l $n' failed"
276 then err_exit "'kill -l $t' failed"
282 err_exit "'kill -l $s' => $n, 'kill -l $n' => $t, kill -l $t => $m -- expected $n"
296 [[ $exp == $got ]] || err_exit "kill -$exp \$\$ failed, required termination by signal '$got'"
301 (( $?==3)) || err_exit "wrong exit status expecting 3 got $?"
303 [[ $x == done ]] || err_exit "wrong result - execting done got $x"
304 (( SECONDS > 3.5 )) && err_exit "took $SECONDS seconds, expecting around 2"
308 [[ $(kill -l $?) == TERM ]] || err_exit "wrong exit status expecting TERM got $(kill -l $?)"
310 [[ $x == done ]] || err_exit "wrong result - execting done got $x"
311 (( SECONDS > 3.5 )) && err_exit "took $SECONDS seconds, expecting around 2"
315 (( $?==3)) || err_exit "wrong exit status expecting 3 got $?"
316 [[ $x == done ]] || err_exit "wrong result - execting done got $x"
317 (( SECONDS < 4 )) && err_exit "took $SECONDS seconds, expecting around 5"
320 [[ $($SHELL -c 'trap date SIGBUS;trap -p SIGBUS') ]] && err_exit 'SIGBUS should not have a trap'