]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/helper: merge test-sigchain into test-tool
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 24 Mar 2018 07:44:58 +0000 (08:44 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 Mar 2018 15:45:47 +0000 (08:45 -0700)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
t/helper/test-sigchain.c
t/helper/test-tool.c
t/helper/test-tool.h
t/t0005-signals.sh

index b50a0818a96ab097caac049fd915e4d048fdeb18..51de8882d06b2bb6ade335c5e321a984f9fdf15a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -679,6 +679,7 @@ TEST_BUILTINS_OBJS += test-run-command.o
 TEST_BUILTINS_OBJS += test-scrap-cache-tree.o
 TEST_BUILTINS_OBJS += test-sha1-array.o
 TEST_BUILTINS_OBJS += test-sha1.o
+TEST_BUILTINS_OBJS += test-sigchain.o
 
 TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
 TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
@@ -686,7 +687,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh
 TEST_PROGRAMS_NEED_X += test-line-buffer
 TEST_PROGRAMS_NEED_X += test-parse-options
 TEST_PROGRAMS_NEED_X += test-write-cache
-TEST_PROGRAMS_NEED_X += test-sigchain
 TEST_PROGRAMS_NEED_X += test-strcmp-offset
 TEST_PROGRAMS_NEED_X += test-string-list
 TEST_PROGRAMS_NEED_X += test-submodule-config
index b71edbd4429184b59b4bd1355d5cfb53970a1876..77ac5bc33f8eb635f78d8ba590c23bbbe4f29636 100644 (file)
@@ -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);
index 691bdcbb3210292e245197fefe7e1e763e93772d..b2cecd594ba572db35fcd7002f939f9cae4cb5cd 100644 (file)
@@ -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)
index d8066e3f63fa6a14397f469df42ba303ee9e7eeb..1d366846f34f7d90e95300f7be221f807fb96e62 100644 (file)
@@ -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
index c16947cf5db97ef66d12c4b48ee81386ea7a103d..4c214bd11c48859f0c4e64dbbe2d783e744eb1d1 100755 (executable)
@@ -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
 '