Skip to content

Commit b618821

Browse files
pcloudsgitster
authored andcommitted
t/helper: merge test-submodule-config 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 c932a5f commit b618821

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,14 +682,14 @@ TEST_BUILTINS_OBJS += test-sha1.o
682682
TEST_BUILTINS_OBJS += test-sigchain.o
683683
TEST_BUILTINS_OBJS += test-strcmp-offset.o
684684
TEST_BUILTINS_OBJS += test-string-list.o
685+
TEST_BUILTINS_OBJS += test-submodule-config.o
685686

686687
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
687688
TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
688689
TEST_PROGRAMS_NEED_X += test-fake-ssh
689690
TEST_PROGRAMS_NEED_X += test-line-buffer
690691
TEST_PROGRAMS_NEED_X += test-parse-options
691692
TEST_PROGRAMS_NEED_X += test-write-cache
692-
TEST_PROGRAMS_NEED_X += test-submodule-config
693693
TEST_PROGRAMS_NEED_X += test-subprocess
694694
TEST_PROGRAMS_NEED_X += test-svn-fe
695695
TEST_PROGRAMS_NEED_X += test-tool

t/helper/test-submodule-config.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 "config.h"
34
#include "submodule-config.h"
@@ -10,7 +11,7 @@ static void die_usage(int argc, const char **argv, const char *msg)
1011
exit(1);
1112
}
1213

13-
int cmd_main(int argc, const char **argv)
14+
int cmd__submodule_config(int argc, const char **argv)
1415
{
1516
const char **arg = argv;
1617
int my_argc = argc;

t/helper/test-tool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ static struct test_cmd cmds[] = {
3737
{ "sigchain", cmd__sigchain },
3838
{ "strcmp-offset", cmd__strcmp_offset },
3939
{ "string-list", cmd__string_list },
40+
{ "submodule-config", cmd__submodule_config },
4041
};
4142

4243
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
@@ -31,5 +31,6 @@ int cmd__sha1(int argc, const char **argv);
3131
int cmd__sigchain(int argc, const char **argv);
3232
int cmd__strcmp_offset(int argc, const char **argv);
3333
int cmd__string_list(int argc, const char **argv);
34+
int cmd__submodule_config(int argc, const char **argv);
3435

3536
#endif

t/t7411-submodule-config.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ test_expect_success 'configuration parsing with error' '
4141
EOF
4242
(
4343
cd repo &&
44-
test_must_fail test-submodule-config "" s 2>actual &&
44+
test_must_fail test-tool submodule-config "" s 2>actual &&
4545
test_i18ngrep "bad config" actual
4646
)
4747
'
@@ -55,7 +55,7 @@ EOF
5555

5656
test_expect_success 'test parsing and lookup of submodule config by path' '
5757
(cd super &&
58-
test-submodule-config \
58+
test-tool submodule-config \
5959
HEAD^ a \
6060
HEAD b \
6161
HEAD^ submodule \
@@ -67,7 +67,7 @@ test_expect_success 'test parsing and lookup of submodule config by path' '
6767

6868
test_expect_success 'test parsing and lookup of submodule config by name' '
6969
(cd super &&
70-
test-submodule-config --name \
70+
test-tool submodule-config --name \
7171
HEAD^ a \
7272
HEAD a \
7373
HEAD^ submodule \
@@ -89,7 +89,7 @@ test_expect_success 'error in one submodule config lets continue' '
8989
git add .gitmodules &&
9090
mv .gitmodules.bak .gitmodules &&
9191
git commit -m "add error" &&
92-
test-submodule-config \
92+
test-tool submodule-config \
9393
HEAD b \
9494
HEAD submodule \
9595
>actual &&
@@ -100,7 +100,7 @@ test_expect_success 'error in one submodule config lets continue' '
100100
test_expect_success 'error message contains blob reference' '
101101
(cd super &&
102102
sha1=$(git rev-parse HEAD) &&
103-
test-submodule-config \
103+
test-tool submodule-config \
104104
HEAD b \
105105
HEAD submodule \
106106
2>actual_err &&
@@ -114,9 +114,9 @@ test_expect_success 'using different treeishs works' '
114114
git tag new_tag &&
115115
tree=$(git rev-parse HEAD^{tree}) &&
116116
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 &&
120120
test_cmp expect actual.1 &&
121121
test_cmp expect actual.2
122122
)
@@ -130,7 +130,7 @@ test_expect_success 'error in history in fetchrecursesubmodule lets continue' '
130130
git config --unset -f .gitmodules \
131131
submodule.submodule.fetchrecursesubmodules &&
132132
git commit -m "add error in fetchrecursesubmodules" &&
133-
test-submodule-config \
133+
test-tool submodule-config \
134134
HEAD b \
135135
HEAD submodule \
136136
>actual &&

0 commit comments

Comments
 (0)