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>
This commit is contained in:
parent
65370d81ef
commit
9038531f1b
2
Makefile
2
Makefile
@ -673,6 +673,7 @@ TEST_BUILTINS_OBJS += test-path-utils.o
|
||||
TEST_BUILTINS_OBJS += test-prio-queue.o
|
||||
TEST_BUILTINS_OBJS += test-read-cache.o
|
||||
TEST_BUILTINS_OBJS += test-ref-store.o
|
||||
TEST_BUILTINS_OBJS += test-regex.o
|
||||
TEST_BUILTINS_OBJS += test-sha1.o
|
||||
|
||||
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
|
||||
@ -681,7 +682,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh
|
||||
TEST_PROGRAMS_NEED_X += test-line-buffer
|
||||
TEST_PROGRAMS_NEED_X += test-parse-options
|
||||
TEST_PROGRAMS_NEED_X += test-write-cache
|
||||
TEST_PROGRAMS_NEED_X += test-regex
|
||||
TEST_PROGRAMS_NEED_X += test-revision-walking
|
||||
TEST_PROGRAMS_NEED_X += test-run-command
|
||||
TEST_PROGRAMS_NEED_X += test-scrap-cache-tree
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "test-tool.h"
|
||||
#include "git-compat-util.h"
|
||||
#include "gettext.h"
|
||||
|
||||
@ -36,7 +37,7 @@ static int test_regex_bug(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cmd_main(int argc, const char **argv)
|
||||
int cmd__regex(int argc, const char **argv)
|
||||
{
|
||||
const char *pat;
|
||||
const char *str;
|
||||
@ -47,8 +48,8 @@ int cmd_main(int argc, const char **argv)
|
||||
if (argc == 2 && !strcmp(argv[1], "--bug"))
|
||||
return test_regex_bug();
|
||||
else if (argc < 3)
|
||||
usage("test-regex --bug\n"
|
||||
"test-regex <pattern> <string> [<options>]");
|
||||
usage("test-tool regex --bug\n"
|
||||
"test-tool regex <pattern> <string> [<options>]");
|
||||
|
||||
argv++;
|
||||
pat = *argv++;
|
||||
|
@ -28,6 +28,7 @@ static struct test_cmd cmds[] = {
|
||||
{ "prio-queue", cmd__prio_queue },
|
||||
{ "read-cache", cmd__read_cache },
|
||||
{ "ref-store", cmd__ref_store },
|
||||
{ "regex", cmd__regex },
|
||||
{ "sha1", cmd__sha1 },
|
||||
};
|
||||
|
||||
|
@ -22,6 +22,7 @@ int cmd__path_utils(int argc, const char **argv);
|
||||
int cmd__prio_queue(int argc, const char **argv);
|
||||
int cmd__read_cache(int argc, const char **argv);
|
||||
int cmd__ref_store(int argc, const char **argv);
|
||||
int cmd__regex(int argc, const char **argv);
|
||||
int cmd__sha1(int argc, const char **argv);
|
||||
|
||||
#endif
|
||||
|
@ -31,7 +31,7 @@ test_expect_success 'git_mkstemps_mode does not fail if fd 0 is not open' '
|
||||
|
||||
test_expect_success 'check for a bug in the regex routines' '
|
||||
# if this test fails, re-build git with NO_REGEX=1
|
||||
test-regex --bug
|
||||
test-tool regex --bug
|
||||
'
|
||||
|
||||
test_done
|
||||
|
@ -12,7 +12,7 @@ test_expect_success GETTEXT_LOCALE 'setup' '
|
||||
'
|
||||
|
||||
test_have_prereq GETTEXT_LOCALE &&
|
||||
test-regex "HALLÓ" "Halló" ICASE &&
|
||||
test-tool regex "HALLÓ" "Halló" ICASE &&
|
||||
test_set_prereq REGEX_LOCALE
|
||||
|
||||
test_expect_success REGEX_LOCALE 'grep literal string, no -F' '
|
||||
|
Loading…
Reference in New Issue
Block a user