OILS / spec / builtin-kill.test.sh View on Github | oils.pub

30 lines, 12 significant
1## oils_failures_allowed: 2
2## compare_shells: dash bash mksh zsh
3
4# Tests for builtins having to do with killing a process
5
6#### Kills the process with SIGTERM
7# Test 1: Basic SIGTERM
8sleep 0.1 &
9pid=$!
10builtin kill -15 $pid
11wait $pid
12echo $? # Should be 143 (128 + SIGTERM)
13## STDOUT:
14143
15## END
16# For some reason mksh doesn't return the same as the others.
17## OK mksh stdout: 0
18## OK dash stdout: 0
19
20#### Kills the process with SIGKILL
21# Test 2: Basic SIGKILL
22sleep 0.1 &
23pid=$!
24builtin kill -9 $pid
25wait $pid
26echo $? # Must be 137 (128 + SIGKILL)
27## STDOUT:
28137
29## END
30## OK dash stdout: 0