Port signal tests to littlecheck

This commit is contained in:
ridiculousfish 2019-06-26 11:07:46 -07:00
parent cdbd0891f7
commit b672e1891e
3 changed files with 22 additions and 17 deletions

View File

@ -1,8 +1,11 @@
# RUN: %fish %s
function alarm --on-signal ALRM
echo ALRM received
end
kill -s ALRM $fish_pid
# CHECK: ALRM received
function anychild --on-process-exit 0
# Type and exit status
@ -11,10 +14,22 @@ end
echo "command false:"
command false
# CHECK: command false:
# CHECK: PROCESS_EXIT 1
# CHECK: JOB_EXIT 0
echo "command true:"
command true
# CHECK: command true:
# CHECK: PROCESS_EXIT 0
# CHECK: JOB_EXIT 0
echo "command false | true:"
command false | command true
# CHECK: command false | true:
# CHECK: PROCESS_EXIT 1
# CHECK: PROCESS_EXIT 0
# CHECK: JOB_EXIT 0
function test_blocks
block -l
@ -22,4 +37,11 @@ function test_blocks
echo "This should come before the event handler"
end
test_blocks
# CHECK: This is the process whose exit event shuld be blocked
# CHECK: This should come before the event handler
echo "Now event handler should have run"
# CHECK: PROCESS_EXIT 0
# CHECK: JOB_EXIT 0
# CHECK: Now event handler should have run
# CHECK: PROCESS_EXIT 0

View File

View File

@ -1,17 +0,0 @@
ALRM received
command false:
PROCESS_EXIT 1
JOB_EXIT 0
command true:
PROCESS_EXIT 0
JOB_EXIT 0
command false | true:
PROCESS_EXIT 1
PROCESS_EXIT 0
JOB_EXIT 0
This is the process whose exit event shuld be blocked
This should come before the event handler
PROCESS_EXIT 0
JOB_EXIT 0
Now event handler should have run
PROCESS_EXIT 0