summaryrefslogtreecommitdiff
path: root/t/t0005-signals.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t0005-signals.sh')
-rwxr-xr-xt/t0005-signals.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/t/t0005-signals.sh b/t/t0005-signals.sh
new file mode 100755
index 0000000000..981437b3a8
--- /dev/null
+++ b/t/t0005-signals.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+test_description='signals work as we expect'
+. ./test-lib.sh
+
+cat >expect <<EOF
+three
+two
+one
+EOF
+
+test_expect_success 'sigchain works' '
+ test-sigchain >actual
+ case "$?" in
+ 143) true ;; # POSIX w/ SIGTERM=15
+ 271) true ;; # ksh w/ SIGTERM=15
+ 3) true ;; # Windows
+ *) false ;;
+ esac &&
+ test_cmp expect actual
+'
+
+test_expect_success !MINGW 'signals are propagated using shell convention' '
+ # we use exec here to avoid any sub-shell interpretation
+ # of the exit code
+ git config alias.sigterm "!exec test-sigchain" &&
+ test_expect_code 143 git sigterm
+'
+
+test_done