diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2018-03-24 08:44:58 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-27 08:45:47 -0700 |
commit | e154a6f3deb27b8f3a0864625ceb004918cef339 (patch) | |
tree | 00723ad466f8cb77e2595c319359dfd625b13576 /t | |
parent | t/helper: merge test-sha1-array into test-tool (diff) | |
download | tgif-e154a6f3deb27b8f3a0864625ceb004918cef339.tar.xz |
t/helper: merge test-sigchain into test-tool
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rw-r--r-- | t/helper/test-sigchain.c | 3 | ||||
-rw-r--r-- | t/helper/test-tool.c | 1 | ||||
-rw-r--r-- | t/helper/test-tool.h | 1 | ||||
-rwxr-xr-x | t/t0005-signals.sh | 4 |
4 files changed, 6 insertions, 3 deletions
diff --git a/t/helper/test-sigchain.c b/t/helper/test-sigchain.c index b71edbd442..77ac5bc33f 100644 --- a/t/helper/test-sigchain.c +++ b/t/helper/test-sigchain.c @@ -1,3 +1,4 @@ +#include "test-tool.h" #include "cache.h" #include "sigchain.h" @@ -13,7 +14,7 @@ X(two) X(three) #undef X -int cmd_main(int argc, const char **argv) { +int cmd__sigchain(int argc, const char **argv) { sigchain_push(SIGTERM, one); sigchain_push(SIGTERM, two); sigchain_push(SIGTERM, three); diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c index 691bdcbb32..b2cecd594b 100644 --- a/t/helper/test-tool.c +++ b/t/helper/test-tool.c @@ -34,6 +34,7 @@ static struct test_cmd cmds[] = { { "scrap-cache-tree", cmd__scrap_cache_tree }, { "sha1-array", cmd__sha1_array }, { "sha1", cmd__sha1 }, + { "sigchain", cmd__sigchain }, }; int cmd_main(int argc, const char **argv) diff --git a/t/helper/test-tool.h b/t/helper/test-tool.h index d8066e3f63..1d366846f3 100644 --- a/t/helper/test-tool.h +++ b/t/helper/test-tool.h @@ -28,5 +28,6 @@ int cmd__run_command(int argc, const char **argv); int cmd__scrap_cache_tree(int argc, const char **argv); int cmd__sha1_array(int argc, const char **argv); int cmd__sha1(int argc, const char **argv); +int cmd__sigchain(int argc, const char **argv); #endif diff --git a/t/t0005-signals.sh b/t/t0005-signals.sh index c16947cf5d..4c214bd11c 100755 --- a/t/t0005-signals.sh +++ b/t/t0005-signals.sh @@ -10,7 +10,7 @@ one EOF test_expect_success 'sigchain works' ' - { test-sigchain >actual; ret=$?; } && + { test-tool sigchain >actual; ret=$?; } && { # Signal death by raise() on Windows acts like exit(3), # regardless of the signal number. So we must allow that @@ -24,7 +24,7 @@ test_expect_success 'sigchain works' ' 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" && + git config alias.sigterm "!exec test-tool sigchain" && test_expect_code 143 git sigterm ' |