t/helper: merge test-regex 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 9038531f1bf71352aa9218e3ea45d5ff7721c4d5
6 files changed +9 -6
Makefile
+1 -1
@@ -673,6 +673,7 @@ TEST_BUILTINS_OBJS += test-path-utils.o
673 TEST_BUILTINS_OBJS += test-prio-queue.o
674 TEST_BUILTINS_OBJS += test-read-cache.o
675 TEST_BUILTINS_OBJS += test-ref-store.o
676 +TEST_BUILTINS_OBJS += test-regex.o
677 TEST_BUILTINS_OBJS += test-sha1.o
678
679 TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
@@ -681,7 +682,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh
682 TEST_PROGRAMS_NEED_X += test-line-buffer
683 TEST_PROGRAMS_NEED_X += test-parse-options
684 TEST_PROGRAMS_NEED_X += test-write-cache
684 -TEST_PROGRAMS_NEED_X += test-regex
685 TEST_PROGRAMS_NEED_X += test-revision-walking
686 TEST_PROGRAMS_NEED_X += test-run-command
687 TEST_PROGRAMS_NEED_X += test-scrap-cache-tree
t/helper/test-regex.c
+4 -3
@@ -1,3 +1,4 @@
1 +#include "test-tool.h"
2 #include "git-compat-util.h"
3 #include "gettext.h"
4
@@ -36,7 +37,7 @@ static int test_regex_bug(void)
37 return 0;
38 }
39
39 -int cmd_main(int argc, const char **argv)
40 +int cmd__regex(int argc, const char **argv)
41 {
42 const char *pat;
43 const char *str;
@@ -47,8 +48,8 @@ int cmd_main(int argc, const char **argv)
48 if (argc == 2 && !strcmp(argv[1], "--bug"))
49 return test_regex_bug();
50 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>]");
53
54 argv++;
55 pat = *argv++;
t/helper/test-tool.c
+1
@@ -28,6 +28,7 @@ static struct test_cmd cmds[] = {
28 { "prio-queue", cmd__prio_queue },
29 { "read-cache", cmd__read_cache },
30 { "ref-store", cmd__ref_store },
31 + { "regex", cmd__regex },
32 { "sha1", cmd__sha1 },
33 };
34
t/helper/test-tool.h
+1
@@ -22,6 +22,7 @@ int cmd__path_utils(int argc, const char **argv);
22 int cmd__prio_queue(int argc, const char **argv);
23 int cmd__read_cache(int argc, const char **argv);
24 int cmd__ref_store(int argc, const char **argv);
25 +int cmd__regex(int argc, const char **argv);
26 int cmd__sha1(int argc, const char **argv);
27
28 #endif
t/t0070-fundamental.sh
+1 -1
@@ -31,7 +31,7 @@ test_expect_success 'git_mkstemps_mode does not fail if fd 0 is not open' '
31
32 test_expect_success 'check for a bug in the regex routines' '
33 # if this test fails, re-build git with NO_REGEX=1
34 - test-regex --bug
34 + test-tool regex --bug
35 '
36
37 test_done
t/t7812-grep-icase-non-ascii.sh
+1 -1
@@ -12,7 +12,7 @@ test_expect_success GETTEXT_LOCALE 'setup' '
12 '
13
14 test_have_prereq GETTEXT_LOCALE &&
15 -test-regex "HALLÓ" "Halló" ICASE &&
15 +test-tool regex "HALLÓ" "Halló" ICASE &&
16 test_set_prereq REGEX_LOCALE
17
18 test_expect_success REGEX_LOCALE 'grep literal string, no -F' '