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>
Nguyễn Thái Ngọc Duy committed
Mar 24, 2018 at 08:44 UTC
e154a6f3deb27b8f3a0864625ceb004918cef339
5 files changed
+7
-4
Makefile
+1
-1
@@ -679,6 +679,7 @@ TEST_BUILTINS_OBJS += test-run-command.o
679
TEST_BUILTINS_OBJS += test-scrap-cache-tree.o
680
TEST_BUILTINS_OBJS += test-sha1-array.o
681
TEST_BUILTINS_OBJS += test-sha1.o
682
+TEST_BUILTINS_OBJS += test-sigchain.o
683
684
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
685
TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
@@ -686,7 +687,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh
687
TEST_PROGRAMS_NEED_X += test-line-buffer
688
TEST_PROGRAMS_NEED_X += test-parse-options
689
TEST_PROGRAMS_NEED_X += test-write-cache
689
-TEST_PROGRAMS_NEED_X += test-sigchain
690
TEST_PROGRAMS_NEED_X += test-strcmp-offset
691
TEST_PROGRAMS_NEED_X += test-string-list
692
TEST_PROGRAMS_NEED_X += test-submodule-config
t/helper/test-sigchain.c
+2
-1
@@ -1,3 +1,4 @@
1
+#include "test-tool.h"
2
#include "cache.h"
3
#include "sigchain.h"
4
@@ -13,7 +14,7 @@ X(two)
14
X(three)
15
#undef X
16
16
-int cmd_main(int argc, const char **argv) {
17
+int cmd__sigchain(int argc, const char **argv) {
18
sigchain_push(SIGTERM, one);
19
sigchain_push(SIGTERM, two);
20
sigchain_push(SIGTERM, three);
t/helper/test-tool.c
+1
@@ -34,6 +34,7 @@ static struct test_cmd cmds[] = {
34
{ "scrap-cache-tree", cmd__scrap_cache_tree },
35
{ "sha1-array", cmd__sha1_array },
36
{ "sha1", cmd__sha1 },
37
+ { "sigchain", cmd__sigchain },
38
};
39
40
int cmd_main(int argc, const char **argv)
t/helper/test-tool.h
+1
@@ -28,5 +28,6 @@ int cmd__run_command(int argc, const char **argv);
28
int cmd__scrap_cache_tree(int argc, const char **argv);
29
int cmd__sha1_array(int argc, const char **argv);
30
int cmd__sha1(int argc, const char **argv);
31
+int cmd__sigchain(int argc, const char **argv);
32
33
#endif
t/t0005-signals.sh
+2
-2
@@ -10,7 +10,7 @@ one
10
EOF
11
12
test_expect_success 'sigchain works' '
13
- { test-sigchain >actual; ret=$?; } &&
13
+ { test-tool sigchain >actual; ret=$?; } &&
14
{
15
# Signal death by raise() on Windows acts like exit(3),
16
# regardless of the signal number. So we must allow that
@@ -24,7 +24,7 @@ test_expect_success 'sigchain works' '
24
test_expect_success !MINGW 'signals are propagated using shell convention' '
25
# we use exec here to avoid any sub-shell interpretation
26
# of the exit code
27
- git config alias.sigterm "!exec test-sigchain" &&
27
+ git config alias.sigterm "!exec test-tool sigchain" &&
28
test_expect_code 143 git sigterm
29
'
30