Skip to content

Commit e154a6f

Browse files
pcloudsgitster
authored andcommitted
t/helper: merge test-sigchain into test-tool
Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent aa218df commit e154a6f

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,14 +679,14 @@ TEST_BUILTINS_OBJS += test-run-command.o
679679
TEST_BUILTINS_OBJS += test-scrap-cache-tree.o
680680
TEST_BUILTINS_OBJS += test-sha1-array.o
681681
TEST_BUILTINS_OBJS += test-sha1.o
682+
TEST_BUILTINS_OBJS += test-sigchain.o
682683

683684
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
684685
TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
685686
TEST_PROGRAMS_NEED_X += test-fake-ssh
686687
TEST_PROGRAMS_NEED_X += test-line-buffer
687688
TEST_PROGRAMS_NEED_X += test-parse-options
688689
TEST_PROGRAMS_NEED_X += test-write-cache
689-
TEST_PROGRAMS_NEED_X += test-sigchain
690690
TEST_PROGRAMS_NEED_X += test-strcmp-offset
691691
TEST_PROGRAMS_NEED_X += test-string-list
692692
TEST_PROGRAMS_NEED_X += test-submodule-config

t/helper/test-sigchain.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "test-tool.h"
12
#include "cache.h"
23
#include "sigchain.h"
34

@@ -13,7 +14,7 @@ X(two)
1314
X(three)
1415
#undef X
1516

16-
int cmd_main(int argc, const char **argv) {
17+
int cmd__sigchain(int argc, const char **argv) {
1718
sigchain_push(SIGTERM, one);
1819
sigchain_push(SIGTERM, two);
1920
sigchain_push(SIGTERM, three);

t/helper/test-tool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ static struct test_cmd cmds[] = {
3434
{ "scrap-cache-tree", cmd__scrap_cache_tree },
3535
{ "sha1-array", cmd__sha1_array },
3636
{ "sha1", cmd__sha1 },
37+
{ "sigchain", cmd__sigchain },
3738
};
3839

3940
int cmd_main(int argc, const char **argv)

t/helper/test-tool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ int cmd__run_command(int argc, const char **argv);
2828
int cmd__scrap_cache_tree(int argc, const char **argv);
2929
int cmd__sha1_array(int argc, const char **argv);
3030
int cmd__sha1(int argc, const char **argv);
31+
int cmd__sigchain(int argc, const char **argv);
3132

3233
#endif

t/t0005-signals.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ one
1010
EOF
1111

1212
test_expect_success 'sigchain works' '
13-
{ test-sigchain >actual; ret=$?; } &&
13+
{ test-tool sigchain >actual; ret=$?; } &&
1414
{
1515
# Signal death by raise() on Windows acts like exit(3),
1616
# regardless of the signal number. So we must allow that
@@ -24,7 +24,7 @@ test_expect_success 'sigchain works' '
2424
test_expect_success !MINGW 'signals are propagated using shell convention' '
2525
# we use exec here to avoid any sub-shell interpretation
2626
# of the exit code
27-
git config alias.sigterm "!exec test-sigchain" &&
27+
git config alias.sigterm "!exec test-tool sigchain" &&
2828
test_expect_code 143 git sigterm
2929
'
3030

0 commit comments

Comments
 (0)