Skip to content

Commit 9038531

Browse files
pcloudsgitster
authored andcommitted
t/helper: merge test-regex 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 65370d8 commit 9038531

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@ TEST_BUILTINS_OBJS += test-path-utils.o
673673
TEST_BUILTINS_OBJS += test-prio-queue.o
674674
TEST_BUILTINS_OBJS += test-read-cache.o
675675
TEST_BUILTINS_OBJS += test-ref-store.o
676+
TEST_BUILTINS_OBJS += test-regex.o
676677
TEST_BUILTINS_OBJS += test-sha1.o
677678

678679
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
@@ -681,7 +682,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh
681682
TEST_PROGRAMS_NEED_X += test-line-buffer
682683
TEST_PROGRAMS_NEED_X += test-parse-options
683684
TEST_PROGRAMS_NEED_X += test-write-cache
684-
TEST_PROGRAMS_NEED_X += test-regex
685685
TEST_PROGRAMS_NEED_X += test-revision-walking
686686
TEST_PROGRAMS_NEED_X += test-run-command
687687
TEST_PROGRAMS_NEED_X += test-scrap-cache-tree

t/helper/test-regex.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include "test-tool.h"
12
#include "git-compat-util.h"
23
#include "gettext.h"
34

@@ -36,7 +37,7 @@ static int test_regex_bug(void)
3637
return 0;
3738
}
3839

39-
int cmd_main(int argc, const char **argv)
40+
int cmd__regex(int argc, const char **argv)
4041
{
4142
const char *pat;
4243
const char *str;
@@ -47,8 +48,8 @@ int cmd_main(int argc, const char **argv)
4748
if (argc == 2 && !strcmp(argv[1], "--bug"))
4849
return test_regex_bug();
4950
else if (argc < 3)
50-
usage("test-regex --bug\n"
51-
"test-regex <pattern> <string> [<options>]");
51+
usage("test-tool regex --bug\n"
52+
"test-tool regex <pattern> <string> [<options>]");
5253

5354
argv++;
5455
pat = *argv++;

t/helper/test-tool.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ static struct test_cmd cmds[] = {
2828
{ "prio-queue", cmd__prio_queue },
2929
{ "read-cache", cmd__read_cache },
3030
{ "ref-store", cmd__ref_store },
31+
{ "regex", cmd__regex },
3132
{ "sha1", cmd__sha1 },
3233
};
3334

t/helper/test-tool.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ int cmd__path_utils(int argc, const char **argv);
2222
int cmd__prio_queue(int argc, const char **argv);
2323
int cmd__read_cache(int argc, const char **argv);
2424
int cmd__ref_store(int argc, const char **argv);
25+
int cmd__regex(int argc, const char **argv);
2526
int cmd__sha1(int argc, const char **argv);
2627

2728
#endif

t/t0070-fundamental.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test_expect_success 'git_mkstemps_mode does not fail if fd 0 is not open' '
3131

3232
test_expect_success 'check for a bug in the regex routines' '
3333
# if this test fails, re-build git with NO_REGEX=1
34-
test-regex --bug
34+
test-tool regex --bug
3535
'
3636

3737
test_done

t/t7812-grep-icase-non-ascii.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ test_expect_success GETTEXT_LOCALE 'setup' '
1212
'
1313

1414
test_have_prereq GETTEXT_LOCALE &&
15-
test-regex "HALLÓ" "Halló" ICASE &&
15+
test-tool regex "HALLÓ" "Halló" ICASE &&
1616
test_set_prereq REGEX_LOCALE
1717

1818
test_expect_success REGEX_LOCALE 'grep literal string, no -F' '

0 commit comments

Comments
 (0)