t/helper: merge test-submodule-config 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:45 UTC b6188213065ee364f7b5518983adabbaa267e380
5 files changed +14 -11
Makefile
+1 -1
@@ -682,6 +682,7 @@ TEST_BUILTINS_OBJS += test-sha1.o
682 TEST_BUILTINS_OBJS += test-sigchain.o
683 TEST_BUILTINS_OBJS += test-strcmp-offset.o
684 TEST_BUILTINS_OBJS += test-string-list.o
685 +TEST_BUILTINS_OBJS += test-submodule-config.o
686
687 TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
688 TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
@@ -689,7 +690,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh
690 TEST_PROGRAMS_NEED_X += test-line-buffer
691 TEST_PROGRAMS_NEED_X += test-parse-options
692 TEST_PROGRAMS_NEED_X += test-write-cache
692 -TEST_PROGRAMS_NEED_X += test-submodule-config
693 TEST_PROGRAMS_NEED_X += test-subprocess
694 TEST_PROGRAMS_NEED_X += test-svn-fe
695 TEST_PROGRAMS_NEED_X += test-tool
t/helper/test-submodule-config.c
+2 -1
@@ -1,3 +1,4 @@
1 +#include "test-tool.h"
2 #include "cache.h"
3 #include "config.h"
4 #include "submodule-config.h"
@@ -10,7 +11,7 @@ static void die_usage(int argc, const char **argv, const char *msg)
11 exit(1);
12 }
13
13 -int cmd_main(int argc, const char **argv)
14 +int cmd__submodule_config(int argc, const char **argv)
15 {
16 const char **arg = argv;
17 int my_argc = argc;
t/helper/test-tool.c
+1
@@ -37,6 +37,7 @@ static struct test_cmd cmds[] = {
37 { "sigchain", cmd__sigchain },
38 { "strcmp-offset", cmd__strcmp_offset },
39 { "string-list", cmd__string_list },
40 + { "submodule-config", cmd__submodule_config },
41 };
42
43 int cmd_main(int argc, const char **argv)
t/helper/test-tool.h
+1
@@ -31,5 +31,6 @@ int cmd__sha1(int argc, const char **argv);
31 int cmd__sigchain(int argc, const char **argv);
32 int cmd__strcmp_offset(int argc, const char **argv);
33 int cmd__string_list(int argc, const char **argv);
34 +int cmd__submodule_config(int argc, const char **argv);
35
36 #endif
t/t7411-submodule-config.sh
+9 -9
@@ -41,7 +41,7 @@ test_expect_success 'configuration parsing with error' '
41 EOF
42 (
43 cd repo &&
44 - test_must_fail test-submodule-config "" s 2>actual &&
44 + test_must_fail test-tool submodule-config "" s 2>actual &&
45 test_i18ngrep "bad config" actual
46 )
47 '
@@ -55,7 +55,7 @@ EOF
55
56 test_expect_success 'test parsing and lookup of submodule config by path' '
57 (cd super &&
58 - test-submodule-config \
58 + test-tool submodule-config \
59 HEAD^ a \
60 HEAD b \
61 HEAD^ submodule \
@@ -67,7 +67,7 @@ test_expect_success 'test parsing and lookup of submodule config by path' '
67
68 test_expect_success 'test parsing and lookup of submodule config by name' '
69 (cd super &&
70 - test-submodule-config --name \
70 + test-tool submodule-config --name \
71 HEAD^ a \
72 HEAD a \
73 HEAD^ submodule \
@@ -89,7 +89,7 @@ test_expect_success 'error in one submodule config lets continue' '
89 git add .gitmodules &&
90 mv .gitmodules.bak .gitmodules &&
91 git commit -m "add error" &&
92 - test-submodule-config \
92 + test-tool submodule-config \
93 HEAD b \
94 HEAD submodule \
95 >actual &&
@@ -100,7 +100,7 @@ test_expect_success 'error in one submodule config lets continue' '
100 test_expect_success 'error message contains blob reference' '
101 (cd super &&
102 sha1=$(git rev-parse HEAD) &&
103 - test-submodule-config \
103 + test-tool submodule-config \
104 HEAD b \
105 HEAD submodule \
106 2>actual_err &&
@@ -114,9 +114,9 @@ test_expect_success 'using different treeishs works' '
114 git tag new_tag &&
115 tree=$(git rev-parse HEAD^{tree}) &&
116 commit=$(git rev-parse HEAD^{commit}) &&
117 - test-submodule-config $commit b >expect &&
118 - test-submodule-config $tree b >actual.1 &&
119 - test-submodule-config new_tag b >actual.2 &&
117 + test-tool submodule-config $commit b >expect &&
118 + test-tool submodule-config $tree b >actual.1 &&
119 + test-tool submodule-config new_tag b >actual.2 &&
120 test_cmp expect actual.1 &&
121 test_cmp expect actual.2
122 )
@@ -130,7 +130,7 @@ test_expect_success 'error in history in fetchrecursesubmodule lets continue' '
130 git config --unset -f .gitmodules \
131 submodule.submodule.fetchrecursesubmodules &&
132 git commit -m "add error in fetchrecursesubmodules" &&
133 - test-submodule-config \
133 + test-tool submodule-config \
134 HEAD b \
135 HEAD submodule \
136 >actual &&