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

28 lines, 12 significant
1## oils_failures_allowed: 2
2## compare_shells: dash bash-4.4 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=$!
10kill -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
19#### Kills the process with SIGKILL
20# Test 2: Basic SIGKILL
21sleep 0.1 &
22pid=$!
23kill -9 $pid
24wait $pid
25echo $? # Must be 137 (128 + SIGKILL)
26## STDOUT:
27137
28## END