]>
Commit | Line | Data |
---|---|---|
4a16d072 JK |
1 | #!/bin/sh |
2 | ||
3 | test_description='signals work as we expect' | |
4 | . ./test-lib.sh | |
5 | ||
6 | cat >expect <<EOF | |
7 | three | |
8 | two | |
9 | one | |
10 | EOF | |
11 | ||
12 | test_expect_success 'sigchain works' ' | |
13 | test-sigchain >actual | |
14 | case "$?" in | |
0ea80396 | 15 | 143) true ;; # POSIX w/ SIGTERM=15 |
0e418e56 | 16 | 271) true ;; # ksh w/ SIGTERM=15 |
4a16d072 JK |
17 | 3) true ;; # Windows |
18 | *) false ;; | |
19 | esac && | |
20 | test_cmp expect actual | |
21 | ' | |
22 | ||
04422c74 | 23 | test_expect_success !MINGW 'signals are propagated using shell convention' ' |
e828908a JK |
24 | # we use exec here to avoid any sub-shell interpretation |
25 | # of the exit code | |
26 | git config alias.sigterm "!exec test-sigchain" && | |
27 | test_expect_code 143 git sigterm | |
28 | ' | |
29 | ||
4a16d072 | 30 | test_done |