t/helper: merge test-ctype into test-tool
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 24 Mar 2018 07:44:35 +0000 (08:44 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 Mar 2018 15:45:47 +0000 (08:45 -0700)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
t/helper/test-ctype.c
t/helper/test-tool.c
t/helper/test-tool.h
t/t0070-fundamental.sh
index 227f16ad17a7e00b4d1110a634d17f81152d3a4b..d09710dc3dc48ae98bf7c001e2dd9d0510e7f75f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -654,10 +654,10 @@ PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
 
 TEST_BUILTINS_OBJS += test-chmtime.o
 TEST_BUILTINS_OBJS += test-config.o
+TEST_BUILTINS_OBJS += test-ctype.o
 TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o
 TEST_BUILTINS_OBJS += test-sha1.o
 
-TEST_PROGRAMS_NEED_X += test-ctype
 TEST_PROGRAMS_NEED_X += test-date
 TEST_PROGRAMS_NEED_X += test-delta
 TEST_PROGRAMS_NEED_X += test-drop-caches
index bb72c47df570d9c07ae4567fd6d31ea49fe49656..92c4c2313e78a305dd0da1e7a853e58e325d2f84 100644 (file)
@@ -1,3 +1,4 @@
+#include "test-tool.h"
 #include "cache.h"
 
 static int rc;
@@ -28,7 +29,7 @@ static int is_in(const char *s, int ch)
 #define LOWER "abcdefghijklmnopqrstuvwxyz"
 #define UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 
-int cmd_main(int argc, const char **argv)
+int cmd__ctype(int argc, const char **argv)
 {
        TEST_CLASS(isdigit, DIGIT);
        TEST_CLASS(isspace, " \n\r\t");
index c23550291d714690e1f85e20727d456788ef3547..a1999495a6bf4a3fcc5a43c3655b2ec02f98b59d 100644 (file)
@@ -9,6 +9,7 @@ struct test_cmd {
 static struct test_cmd cmds[] = {
        { "chmtime", cmd__chmtime },
        { "config", cmd__config },
+       { "ctype", cmd__ctype },
        { "lazy-init-name-hash", cmd__lazy_init_name_hash },
        { "sha1", cmd__sha1 },
 };
index 3084f458a040d4f5d5f3e0e34e7f75164a8ad0d4..41805ecd1c63a416be2fb4d0c74acae86edb9683 100644 (file)
@@ -3,6 +3,7 @@
 
 int cmd__chmtime(int argc, const char **argv);
 int cmd__config(int argc, const char **argv);
+int cmd__ctype(int argc, const char **argv);
 int cmd__lazy_init_name_hash(int argc, const char **argv);
 int cmd__sha1(int argc, const char **argv);
 
index 991ed2a48dbf15fb4cb794a587ad900071391e11..70d4d98a2e22659396c401ccc0deed1eadd7265a 100755 (executable)
@@ -9,7 +9,7 @@ Verify wrappers and compatibility functions.
 . ./test-lib.sh
 
 test_expect_success 'character classes (isspace, isalpha etc.)' '
-       test-ctype
+       test-tool ctype
 '
 
 test_expect_success 'mktemp to nonexistent directory prints filename' '