Combine t/helper binaries into a single one
Subsystems (2)
PATCH v2 21/36 t/helper: merge test-prio-queue into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-prio-queue.c | 3 ++- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/t0009-prio-queue.sh | 6 +++--- 5 files changed, 8 insertions(+), 5 deletions(-)
Makefile +1 -1
@@ -670,6 +670,7 @@ TEST_BUILTINS_OBJS += test-mergesort.o TEST_BUILTINS_OBJS += test-mktemp.o TEST_BUILTINS_OBJS += test-online-cpus.o TEST_BUILTINS_OBJS += test-path-utils.o +TEST_BUILTINS_OBJS += test-prio-queue.o TEST_BUILTINS_OBJS += test-sha1.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
@@ -677,7 +678,6 @@ TEST_PROGRAMS_NEED_X += test-dump-untracked-cache 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-prio-queue TEST_PROGRAMS_NEED_X += test-read-cache TEST_PROGRAMS_NEED_X += test-write-cache TEST_PROGRAMS_NEED_X += test-ref-store
t/helper/test-prio-queue.c +2 -1
@@ -1,3 +1,4 @@ +#include "test-tool.h" #include "cache.h" #include "prio-queue.h"
@@ -16,7 +17,7 @@ static void show(int *v)free (v); } -int cmd_main (int argc,const char **argv) +int cmd__prio_queue (int argc,const char **argv) {struct prio_queue pq = { intcmp };
t/helper/test-tool.c +1 -0
@@ -25,6 +25,7 @@ static struct test_cmd cmds[] = { { "mktemp", cmd__mktemp }, { "online-cpus", cmd__online_cpus }, { "path-utils", cmd__path_utils }, + { "prio-queue", cmd__prio_queue }, { "sha1", cmd__sha1 }, };
t/helper/test-tool.h +1 -0
@@ -19,6 +19,7 @@ int cmd__mergesort(int argc, const char **argv);int cmd__mktemp (int argc,const char **argv);int cmd__online_cpus (int argc,const char **argv);int cmd__path_utils (int argc,const char **argv); +int cmd__prio_queue (int argc,const char **argv);int cmd__sha1 (int argc,const char **argv);#endif
t/t0009-prio-queue.sh +3 -3
@@ -17,7 +17,7 @@ cat >expect <<'EOF' 10 EOF test_expect_success 'basic ordering' ' - test-prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual && + test-tool prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual && test_cmp expect actual '
@@ -30,7 +30,7 @@ cat >expect <<'EOF' 6 EOF test_expect_success 'mixed put and get' ' - test-prio-queue 6 2 4 get 5 3 get get 1 dump >actual && + test-tool prio-queue 6 2 4 get 5 3 get get 1 dump >actual && test_cmp expect actual '
@@ -43,7 +43,7 @@ NULL NULL EOF test_expect_success 'notice empty queue' ' - test-prio-queue 1 2 get get get 1 2 get get get >actual && + test-tool prio-queue 1 2 get get get 1 2 get get get >actual && test_cmp expect actual '
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
PATCH v2 22/36 t/helper: merge test-read-cache into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-read-cache.c | 3 ++- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/perf/p0002-read-cache.sh | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-)
Makefile +1 -1
@@ -671,6 +671,7 @@ TEST_BUILTINS_OBJS += test-mktemp.o TEST_BUILTINS_OBJS += test-online-cpus.o 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-sha1.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
@@ -678,7 +679,6 @@ TEST_PROGRAMS_NEED_X += test-dump-untracked-cache 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-read-cache TEST_PROGRAMS_NEED_X += test-write-cache TEST_PROGRAMS_NEED_X += test-ref-store TEST_PROGRAMS_NEED_X += test-regex
t/helper/test-read-cache.c +2 -1
@@ -1,6 +1,7 @@ +#include "test-tool.h" #include "cache.h" -int cmd_main (int argc,const char **argv) +int cmd__read_cache (int argc,const char **argv) {int i, cnt =1 ;if (argc ==2 )
t/helper/test-tool.c +1 -0
@@ -26,6 +26,7 @@ static struct test_cmd cmds[] = { { "online-cpus", cmd__online_cpus }, { "path-utils", cmd__path_utils }, { "prio-queue", cmd__prio_queue }, + { "read-cache", cmd__read_cache }, { "sha1", cmd__sha1 }, };
t/helper/test-tool.h +1 -0
@@ -20,6 +20,7 @@ int cmd__mktemp(int argc, const char **argv);int cmd__online_cpus (int argc,const char **argv);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__sha1 (int argc,const char **argv);#endif
t/perf/p0002-read-cache.sh +1 -1
@@ -8,7 +8,7 @@ test_perf_default_repo count=1000 test_perf "read_cache/discard_cache $count times" " - test-read-cache $count + test-tool read-cache $count " test_done
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
PATCH v2 23/36 t/helper: merge test-ref-store into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-ref-store.c | 3 ++- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/t1405-main-ref-store.sh | 2 +- t/t1406-submodule-ref-store.sh | 2 +- t/t1407-worktree-ref-store.sh | 4 ++-- 7 files changed, 9 insertions(+), 6 deletions(-)
Makefile +1 -1
@@ -672,6 +672,7 @@ TEST_BUILTINS_OBJS += test-online-cpus.o 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-sha1.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
@@ -680,7 +681,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-ref-store TEST_PROGRAMS_NEED_X += test-regex TEST_PROGRAMS_NEED_X += test-revision-walking TEST_PROGRAMS_NEED_X += test-run-command
t/helper/test-ref-store.c +2 -1
@@ -1,3 +1,4 @@ +#include "test-tool.h" #include "cache.h" #include "refs.h" #include "worktree.h"
@@ -274,7 +275,7 @@ static struct command commands[] = { { NULL, NULL } }; -int cmd_main (int argc,const char **argv) +int cmd__ref_store (int argc,const char **argv) {struct ref_store *refs;const char *func;
t/helper/test-tool.c +1 -0
@@ -27,6 +27,7 @@ static struct test_cmd cmds[] = { { "path-utils", cmd__path_utils }, { "prio-queue", cmd__prio_queue }, { "read-cache", cmd__read_cache }, + { "ref-store", cmd__ref_store }, { "sha1", cmd__sha1 }, };
t/helper/test-tool.h +1 -0
@@ -21,6 +21,7 @@ int cmd__online_cpus(int argc, const char **argv);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__sha1 (int argc,const char **argv);#endif
t/t1405-main-ref-store.sh +1 -1
@@ -4,7 +4,7 @@ test_description='test main ref store api' . ./test-lib.sh -RUN="test-ref-store main" +RUN="test-tool ref-store main" test_expect_success 'pack_refs(PACK_REFS_ALL | PACK_REFS_PRUNE)' ' test_commit one &&
t/t1406-submodule-ref-store.sh +1 -1
@@ -4,7 +4,7 @@ test_description='test submodule ref store api' . ./test-lib.sh -RUN="test-ref-store submodule:sub" +RUN="test-tool ref-store submodule:sub" test_expect_success 'setup' ' git init sub &&
t/t1407-worktree-ref-store.sh +2 -2
@@ -4,8 +4,8 @@ test_description='test worktree ref store api' . ./test-lib.sh -RWT="test-ref-store worktree:wt" -RMAIN="test-ref-store worktree:main" +RWT="test-tool ref-store worktree:wt" +RMAIN="test-tool ref-store worktree:main" test_expect_success 'setup' ' test_commit first &&
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
PATCH v2 24/36 t/helper: merge test-regex into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-regex.c | 7 ++++--- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/t0070-fundamental.sh | 2 +- t/t7812-grep-icase-non-ascii.sh | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-)
Makefile +1 -1
@@ -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
t/helper/test-regex.c +4 -3
@@ -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++;
t/helper/test-tool.c +1 -0
@@ -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 }, };
t/helper/test-tool.h +1 -0
@@ -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
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' ' 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
t/t7812-grep-icase-non-ascii.sh +1 -1
@@ -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' '
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
PATCH v2 25/36 t/helper: merge test-revision-walking into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-revision-walking.c | 3 ++- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/t0062-revision-walking.sh | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-)
Makefile +1 -1
@@ -674,6 +674,7 @@ 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-revision-walking.o TEST_BUILTINS_OBJS += test-sha1.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
@@ -682,7 +683,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-revision-walking TEST_PROGRAMS_NEED_X += test-run-command TEST_PROGRAMS_NEED_X += test-scrap-cache-tree TEST_PROGRAMS_NEED_X += test-sha1-array
t/helper/test-revision-walking.c +2 -1
@@ -8,6 +8,7 @@* published by the Free Software Foundation. */ +#include "test-tool.h" #include "cache.h" #include "commit.h" #include "diff.h"
@@ -45,7 +46,7 @@ static int run_revision_walk(void)return got_revision; } -int cmd_main (int argc,const char **argv) +int cmd__revision_walking (int argc,const char **argv) {if (argc <2 )return 1 ;
t/helper/test-tool.c +1 -0
@@ -29,6 +29,7 @@ static struct test_cmd cmds[] = { { "read-cache", cmd__read_cache }, { "ref-store", cmd__ref_store }, { "regex", cmd__regex }, + { "revision-walking", cmd__revision_walking }, { "sha1", cmd__sha1 }, };
t/helper/test-tool.h +1 -0
@@ -23,6 +23,7 @@ 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__revision_walking (int argc,const char **argv);int cmd__sha1 (int argc,const char **argv);#endif
t/t0062-revision-walking.sh +1 -1
@@ -26,7 +26,7 @@ test_expect_success 'setup' ' ' test_expect_success 'revision walking can be done twice' ' - test-revision-walking run-twice >run_twice_actual && + test-tool revision-walking run-twice >run_twice_actual && test_cmp run_twice_expected run_twice_actual '
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
PATCH v2 26/36 t/helper: merge test-run-command into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-run-command.c | 3 ++- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/t0061-run-command.sh | 24 ++++++++++++------------ 5 files changed, 17 insertions(+), 14 deletions(-)
Makefile +1 -1
@@ -675,6 +675,7 @@ TEST_BUILTINS_OBJS += test-read-cache.o TEST_BUILTINS_OBJS += test-ref-store.o TEST_BUILTINS_OBJS += test-regex.o TEST_BUILTINS_OBJS += test-revision-walking.o +TEST_BUILTINS_OBJS += test-run-command.o TEST_BUILTINS_OBJS += test-sha1.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
@@ -683,7 +684,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-run-command TEST_PROGRAMS_NEED_X += test-scrap-cache-tree TEST_PROGRAMS_NEED_X += test-sha1-array TEST_PROGRAMS_NEED_X += test-sigchain
t/helper/test-run-command.c +2 -1
@@ -8,6 +8,7 @@* published by the Free Software Foundation. */ +#include "test-tool.h" #include "git-compat-util.h" #include "run-command.h" #include "argv-array.h"
@@ -49,7 +50,7 @@ static int task_finished(int result,return 1 ; } -int cmd_main (int argc,const char **argv) +int cmd__run_command (int argc,const char **argv) {struct child_process proc =CHILD_PROCESS_INIT ;int jobs;
t/helper/test-tool.c +1 -0
@@ -30,6 +30,7 @@ static struct test_cmd cmds[] = { { "ref-store", cmd__ref_store }, { "regex", cmd__regex }, { "revision-walking", cmd__revision_walking }, + { "run-command", cmd__run_command }, { "sha1", cmd__sha1 }, };
t/helper/test-tool.h +1 -0
@@ -24,6 +24,7 @@ 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__revision_walking (int argc,const char **argv); +int cmd__run_command (int argc,const char **argv);int cmd__sha1 (int argc,const char **argv);#endif
t/t0061-run-command.sh +12 -12
@@ -14,13 +14,13 @@ EOF >empty test_expect_success 'start_command reports ENOENT' ' - test-run-command start-command-ENOENT ./does-not-exist + test-tool run-command start-command-ENOENT ./does-not-exist ' test_expect_success 'run_command can run a command' ' cat hello-script >hello.sh && chmod +x hello.sh && - test-run-command run-command ./hello.sh >actual 2>err && + test-tool run-command run-command ./hello.sh >actual 2>err && test_cmp hello-script actual && test_cmp empty err
@@ -31,7 +31,7 @@ test_expect_success !MINGW 'run_command can run a script without a #! line' ' cat hello-script EOF chmod +x hello && - test-run-command run-command ./hello >actual 2>err && + test-tool run-command run-command ./hello >actual 2>err && test_cmp hello-script actual && test_cmp empty err
@@ -45,7 +45,7 @@ test_expect_success 'run_command does not try to execute a directory' ' EOF PATH=$PWD/bin1:$PWD/bin2:$PATH \ - test-run-command run-command greet >actual 2>err && + test-tool run-command run-command greet >actual 2>err && test_cmp bin2/greet actual && test_cmp empty err '
@@ -62,7 +62,7 @@ test_expect_success POSIXPERM 'run_command passes over non-executable file' ' EOF PATH=$PWD/bin1:$PWD/bin2:$PATH \ - test-run-command run-command greet >actual 2>err && + test-tool run-command run-command greet >actual 2>err && test_cmp bin2/greet actual && test_cmp empty err '
@@ -70,7 +70,7 @@ test_expect_success POSIXPERM 'run_command passes over non-executable file' ' test_expect_success POSIXPERM 'run_command reports EACCES' ' cat hello-script >hello.sh && chmod -x hello.sh && - test_must_fail test-run-command run-command ./hello.sh 2>err && + test_must_fail test-tool run-command run-command ./hello.sh 2>err && grep "fatal: cannot exec.*hello.sh" err '
@@ -104,17 +104,17 @@ World EOF test_expect_success 'run_command runs in parallel with more jobs available than tasks' ' - test-run-command run-command-parallel 5 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual && + test-tool run-command run-command-parallel 5 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual && test_cmp expect actual ' test_expect_success 'run_command runs in parallel with as many jobs as tasks' ' - test-run-command run-command-parallel 4 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual && + test-tool run-command run-command-parallel 4 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual && test_cmp expect actual ' test_expect_success 'run_command runs in parallel with more tasks than jobs available' ' - test-run-command run-command-parallel 3 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual && + test-tool run-command run-command-parallel 3 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual && test_cmp expect actual '
@@ -128,7 +128,7 @@ asking for a quick stop EOF test_expect_success 'run_command is asked to abort gracefully' ' - test-run-command run-command-abort 3 false 2>actual && + test-tool run-command run-command-abort 3 false 2>actual && test_cmp expect actual '
@@ -137,14 +137,14 @@ no further jobs available EOF test_expect_success 'run_command outputs ' ' - test-run-command run-command-no-jobs 3 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual && + test-tool run-command run-command-no-jobs 3 sh -c "printf \"%s\n%s\n\" Hello World" 2>actual && test_cmp expect actual ' test_trace () { expect="$1" shift - GIT_TRACE=1 test-run-command "$@" run-command true 2>&1 >/dev/null | \ + GIT_TRACE=1 test-tool run-command "$@" run-command true 2>&1 >/dev/null | \ sed 's/.* run_command: //' >actual && echo "$expect true" >expect && test_cmp expect actual
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
PATCH v2 27/36 t/helper: merge test-scrap-cache-tree into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-scrap-cache-tree.c | 3 ++- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/t0090-cache-tree.sh | 8 ++++---- 5 files changed, 9 insertions(+), 6 deletions(-)
Makefile +1 -1
@@ -676,6 +676,7 @@ TEST_BUILTINS_OBJS += test-ref-store.o TEST_BUILTINS_OBJS += test-regex.o TEST_BUILTINS_OBJS += test-revision-walking.o TEST_BUILTINS_OBJS += test-run-command.o +TEST_BUILTINS_OBJS += test-scrap-cache-tree.o TEST_BUILTINS_OBJS += test-sha1.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
@@ -684,7 +685,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-scrap-cache-tree TEST_PROGRAMS_NEED_X += test-sha1-array TEST_PROGRAMS_NEED_X += test-sigchain TEST_PROGRAMS_NEED_X += test-strcmp-offset
t/helper/test-scrap-cache-tree.c +2 -1
@@ -1,3 +1,4 @@ +#include "test-tool.h" #include "cache.h" #include "lockfile.h" #include "tree.h"
@@ -5,7 +6,7 @@static struct lock_file index_lock; -int cmd_main (int ac,const char **av) +int cmd__scrap_cache_tree (int ac,const char **av) {setup_git_directory ();hold_locked_index (&index_lock,LOCK_DIE_ON_ERROR );
t/helper/test-tool.c +1 -0
@@ -31,6 +31,7 @@ static struct test_cmd cmds[] = { { "regex", cmd__regex }, { "revision-walking", cmd__revision_walking }, { "run-command", cmd__run_command }, + { "scrap-cache-tree", cmd__scrap_cache_tree }, { "sha1", cmd__sha1 }, };
t/helper/test-tool.h +1 -0
@@ -25,6 +25,7 @@ int cmd__ref_store(int argc, const char **argv);int cmd__regex (int argc,const char **argv);int cmd__revision_walking (int argc,const char **argv);int cmd__run_command (int argc,const char **argv); +int cmd__scrap_cache_tree (int argc,const char **argv);int cmd__sha1 (int argc,const char **argv);#endif
t/t0090-cache-tree.sh +4 -4
@@ -115,14 +115,14 @@ test_expect_success 'update-index invalidates cache-tree' ' ' test_expect_success 'write-tree establishes cache-tree' ' - test-scrap-cache-tree && + test-tool scrap-cache-tree && git write-tree && test_cache_tree ' -test_expect_success 'test-scrap-cache-tree works' ' +test_expect_success 'test-tool scrap-cache-tree works' ' git read-tree HEAD && - test-scrap-cache-tree && + test-tool scrap-cache-tree && test_no_cache_tree '
@@ -170,7 +170,7 @@ test_expect_success 'commit in child dir has cache-tree' ' ' test_expect_success 'reset --hard gives cache-tree' ' - test-scrap-cache-tree && + test-tool scrap-cache-tree && git reset --hard && test_cache_tree '
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
PATCH v2 28/36 t/helper: merge test-sha1-array into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-sha1-array.c | 3 ++- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/t0064-sha1-array.sh | 16 ++++++++-------- 5 files changed, 13 insertions(+), 10 deletions(-)
Makefile +1 -1
@@ -677,6 +677,7 @@ TEST_BUILTINS_OBJS += test-regex.o TEST_BUILTINS_OBJS += test-revision-walking.o TEST_BUILTINS_OBJS += test-run-command.o TEST_BUILTINS_OBJS += test-scrap-cache-tree.o +TEST_BUILTINS_OBJS += test-sha1-array.o TEST_BUILTINS_OBJS += test-sha1.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
@@ -685,7 +686,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-sha1-array TEST_PROGRAMS_NEED_X += test-sigchain TEST_PROGRAMS_NEED_X += test-strcmp-offset TEST_PROGRAMS_NEED_X += test-string-list
t/helper/test-sha1-array.c +2 -1
@@ -1,3 +1,4 @@ +#include "test-tool.h" #include "cache.h" #include "sha1-array.h"
@@ -7,7 +8,7 @@ static int print_oid(const struct object_id *oid, void *data)return 0 ; } -int cmd_main (int argc,const char **argv) +int cmd__sha1_array (int argc,const char **argv) {struct oid_array array =OID_ARRAY_INIT ;struct strbuf line =STRBUF_INIT ;
t/helper/test-tool.c +1 -0
@@ -32,6 +32,7 @@ static struct test_cmd cmds[] = { { "revision-walking", cmd__revision_walking }, { "run-command", cmd__run_command }, { "scrap-cache-tree", cmd__scrap_cache_tree }, + { "sha1-array", cmd__sha1_array }, { "sha1", cmd__sha1 }, };
t/helper/test-tool.h +1 -0
@@ -26,6 +26,7 @@ int cmd__regex(int argc, const char **argv);int cmd__revision_walking (int argc,const char **argv);int cmd__run_command (int argc,const char **argv);int cmd__scrap_cache_tree (int argc,const char **argv); +int cmd__sha1_array (int argc,const char **argv);int cmd__sha1 (int argc,const char **argv);#endif
t/t0064-sha1-array.sh +8 -8
@@ -18,7 +18,7 @@ test_expect_success 'ordered enumeration' ' { echo20 append 88 44 aa 55 && echo for_each_unique - } | test-sha1-array >actual && + } | test-tool sha1-array >actual && test_cmp expect actual '
@@ -28,7 +28,7 @@ test_expect_success 'ordered enumeration with duplicate suppression' ' echo20 append 88 44 aa 55 && echo20 append 88 44 aa 55 && echo for_each_unique - } | test-sha1-array >actual && + } | test-tool sha1-array >actual && test_cmp expect actual '
@@ -36,7 +36,7 @@ test_expect_success 'lookup' ' { echo20 append 88 44 aa 55 && echo20 lookup 55 - } | test-sha1-array >actual && + } | test-tool sha1-array >actual && n=$(cat actual) && test "$n" -eq 1 '
@@ -45,7 +45,7 @@ test_expect_success 'lookup non-existing entry' ' { echo20 append 88 44 aa 55 && echo20 lookup 33 - } | test-sha1-array >actual && + } | test-tool sha1-array >actual && n=$(cat actual) && test "$n" -lt 0 '
@@ -55,7 +55,7 @@ test_expect_success 'lookup with duplicates' ' echo20 append 88 44 aa 55 && echo20 append 88 44 aa 55 && echo20 lookup 55 - } | test-sha1-array >actual && + } | test-tool sha1-array >actual && n=$(cat actual) && test "$n" -ge 2 && test "$n" -le 3
@@ -66,7 +66,7 @@ test_expect_success 'lookup non-existing entry with duplicates' ' echo20 append 88 44 aa 55 && echo20 append 88 44 aa 55 && echo20 lookup 66 - } | test-sha1-array >actual && + } | test-tool sha1-array >actual && n=$(cat actual) && test "$n" -lt 0 '
@@ -76,7 +76,7 @@ test_expect_success 'lookup with almost duplicate values' ' echo "append 5555555555555555555555555555555555555555" && echo "append 555555555555555555555555555555555555555f" && echo20 lookup 55 - } | test-sha1-array >actual && + } | test-tool sha1-array >actual && n=$(cat actual) && test "$n" -eq 0 '
@@ -85,7 +85,7 @@ test_expect_success 'lookup with single duplicate value' ' { echo20 append 55 55 && echo20 lookup 55 - } | test-sha1-array >actual && + } | test-tool sha1-array >actual && n=$(cat actual) && test "$n" -ge 0 && test "$n" -le 1
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
PATCH v2 29/36 t/helper: merge test-sigchain into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-sigchain.c | 3 ++- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/t0005-signals.sh | 4 ++-- 5 files changed, 7 insertions(+), 4 deletions(-)
Makefile +1 -1
@@ -679,6 +679,7 @@ TEST_BUILTINS_OBJS += test-run-command.o TEST_BUILTINS_OBJS += test-scrap-cache-tree.o TEST_BUILTINS_OBJS += test-sha1-array.o TEST_BUILTINS_OBJS += test-sha1.o +TEST_BUILTINS_OBJS += test-sigchain.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
@@ -686,7 +687,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-sigchain TEST_PROGRAMS_NEED_X += test-strcmp-offset TEST_PROGRAMS_NEED_X += test-string-list TEST_PROGRAMS_NEED_X += test-submodule-config
t/helper/test-sigchain.c +2 -1
@@ -1,3 +1,4 @@ +#include "test-tool.h" #include "cache.h" #include "sigchain.h"
@@ -13,7 +14,7 @@ X(two) X(three)#undef X -int cmd_main (int argc,const char **argv) { +int cmd__sigchain (int argc,const char **argv) {sigchain_push (SIGTERM , one);sigchain_push (SIGTERM , two);sigchain_push (SIGTERM , three);
t/helper/test-tool.c +1 -0
@@ -34,6 +34,7 @@ static struct test_cmd cmds[] = { { "scrap-cache-tree", cmd__scrap_cache_tree }, { "sha1-array", cmd__sha1_array }, { "sha1", cmd__sha1 }, + { "sigchain", cmd__sigchain }, };int cmd_main (int argc,const char **argv)
t/helper/test-tool.h +1 -0
@@ -28,5 +28,6 @@ int cmd__run_command(int argc, const char **argv);int cmd__scrap_cache_tree (int argc,const char **argv);int cmd__sha1_array (int argc,const char **argv);int cmd__sha1 (int argc,const char **argv); +int cmd__sigchain (int argc,const char **argv);#endif
t/t0005-signals.sh +2 -2
@@ -10,7 +10,7 @@ one EOF test_expect_success 'sigchain works' ' - { test-sigchain >actual; ret=$?; } && + { test-tool sigchain >actual; ret=$?; } && { # Signal death by raise() on Windows acts like exit(3), # regardless of the signal number. So we must allow that
@@ -24,7 +24,7 @@ test_expect_success 'sigchain works' ' test_expect_success !MINGW 'signals are propagated using shell convention' ' # we use exec here to avoid any sub-shell interpretation # of the exit code - git config alias.sigterm "!exec test-sigchain" && + git config alias.sigterm "!exec test-tool sigchain" && test_expect_code 143 git sigterm '
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
PATCH v2 30/36 t/helper: merge test-strcmp-offset into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-strcmp-offset.c | 3 ++- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/t0065-strcmp-offset.sh | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-)
Makefile +1 -1
@@ -680,6 +680,7 @@ TEST_BUILTINS_OBJS += test-scrap-cache-tree.o TEST_BUILTINS_OBJS += test-sha1-array.o TEST_BUILTINS_OBJS += test-sha1.o TEST_BUILTINS_OBJS += test-sigchain.o +TEST_BUILTINS_OBJS += test-strcmp-offset.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
@@ -687,7 +688,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-strcmp-offset TEST_PROGRAMS_NEED_X += test-string-list TEST_PROGRAMS_NEED_X += test-submodule-config TEST_PROGRAMS_NEED_X += test-subprocess
t/helper/test-strcmp-offset.c +2 -1
@@ -1,6 +1,7 @@ +#include "test-tool.h" #include "cache.h" -int cmd_main (int argc,const char **argv) +int cmd__strcmp_offset (int argc,const char **argv) {int result;size_t offset;
t/helper/test-tool.c +1 -0
@@ -35,6 +35,7 @@ static struct test_cmd cmds[] = { { "sha1-array", cmd__sha1_array }, { "sha1", cmd__sha1 }, { "sigchain", cmd__sigchain }, + { "strcmp-offset", cmd__strcmp_offset }, };int cmd_main (int argc,const char **argv)
t/helper/test-tool.h +1 -0
@@ -29,5 +29,6 @@ int cmd__scrap_cache_tree(int argc, const char **argv);int cmd__sha1_array (int argc,const char **argv);int cmd__sha1 (int argc,const char **argv);int cmd__sigchain (int argc,const char **argv); +int cmd__strcmp_offset (int argc,const char **argv);#endif
t/t0065-strcmp-offset.sh +1 -1
@@ -8,7 +8,7 @@ while read s1 s2 expect do test_expect_success "strcmp_offset($s1, $s2)" ' echo "$expect" >expect && - test-strcmp-offset "$s1" "$s2" >actual && + test-tool strcmp-offset "$s1" "$s2" >actual && test_cmp expect actual ' done <<-EOF
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
PATCH v2 31/36 t/helper: merge test-string-list into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-string-list.c | 3 ++- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/perf/p0071-sort.sh | 2 +- t/t0063-string-list.sh | 48 ++++++++++++++++++------------------- 6 files changed, 30 insertions(+), 27 deletions(-)
Makefile +1 -1
@@ -681,6 +681,7 @@ TEST_BUILTINS_OBJS += test-sha1-array.o TEST_BUILTINS_OBJS += test-sha1.o TEST_BUILTINS_OBJS += test-sigchain.o TEST_BUILTINS_OBJS += test-strcmp-offset.o +TEST_BUILTINS_OBJS += test-string-list.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
@@ -688,7 +689,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-string-list TEST_PROGRAMS_NEED_X += test-submodule-config TEST_PROGRAMS_NEED_X += test-subprocess TEST_PROGRAMS_NEED_X += test-svn-fe
t/helper/test-string-list.c +2 -1
@@ -1,3 +1,4 @@ +#include "test-tool.h" #include "cache.h" #include "string-list.h"
@@ -41,7 +42,7 @@ static int prefix_cb(struct string_list_item *item, void *cb_data)return starts_with (item->string, prefix); } -int cmd_main (int argc,const char **argv) +int cmd__string_list (int argc,const char **argv) {if (argc ==5 && !strcmp (argv[1 ],"split" )) {struct string_list list =STRING_LIST_INIT_DUP ;
t/helper/test-tool.c +1 -0
@@ -36,6 +36,7 @@ static struct test_cmd cmds[] = { { "sha1", cmd__sha1 }, { "sigchain", cmd__sigchain }, { "strcmp-offset", cmd__strcmp_offset }, + { "string-list", cmd__string_list }, };int cmd_main (int argc,const char **argv)
t/helper/test-tool.h +1 -0
@@ -30,5 +30,6 @@ int cmd__sha1_array(int argc, const char **argv);int cmd__sha1 (int argc,const char **argv);int cmd__sigchain (int argc,const char **argv);int cmd__strcmp_offset (int argc,const char **argv); +int cmd__string_list (int argc,const char **argv);#endif
t/perf/p0071-sort.sh +1 -1
@@ -16,7 +16,7 @@ test_perf 'sort(1)' ' ' test_perf 'string_list_sort()' ' - test-string-list sort <unsorted >actual + test-tool string-list sort <unsorted >actual ' test_expect_success 'string_list_sort() sorts like sort(1)' '
t/t0063-string-list.sh +24 -24
64 lines not on this page · raw message
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
PATCH v2 32/36 t/helper: merge test-submodule-config into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-submodule-config.c | 3 ++- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/t7411-submodule-config.sh | 18 +++++++++--------- 5 files changed, 14 insertions(+), 11 deletions(-)
Makefile +1 -1
@@ -682,6 +682,7 @@ TEST_BUILTINS_OBJS += test-sha1.o TEST_BUILTINS_OBJS += test-sigchain.o TEST_BUILTINS_OBJS += test-strcmp-offset.o TEST_BUILTINS_OBJS += test-string-list.o +TEST_BUILTINS_OBJS += test-submodule-config.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
@@ -689,7 +690,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-submodule-config TEST_PROGRAMS_NEED_X += test-subprocess TEST_PROGRAMS_NEED_X += test-svn-fe TEST_PROGRAMS_NEED_X += test-tool
t/helper/test-submodule-config.c +2 -1
@@ -1,3 +1,4 @@ +#include "test-tool.h" #include "cache.h" #include "config.h" #include "submodule-config.h"
@@ -10,7 +11,7 @@ static void die_usage(int argc, const char **argv, const char *msg)exit (1 ); } -int cmd_main (int argc,const char **argv) +int cmd__submodule_config (int argc,const char **argv) {const char **arg = argv;int my_argc = argc;
t/helper/test-tool.c +1 -0
@@ -37,6 +37,7 @@ static struct test_cmd cmds[] = { { "sigchain", cmd__sigchain }, { "strcmp-offset", cmd__strcmp_offset }, { "string-list", cmd__string_list }, + { "submodule-config", cmd__submodule_config }, };int cmd_main (int argc,const char **argv)
t/helper/test-tool.h +1 -0
@@ -31,5 +31,6 @@ int cmd__sha1(int argc, const char **argv);int cmd__sigchain (int argc,const char **argv);int cmd__strcmp_offset (int argc,const char **argv);int cmd__string_list (int argc,const char **argv); +int cmd__submodule_config (int argc,const char **argv);#endif
t/t7411-submodule-config.sh +9 -9
@@ -41,7 +41,7 @@ test_expect_success 'configuration parsing with error' ' EOF ( cd repo && - test_must_fail test-submodule-config "" s 2>actual && + test_must_fail test-tool submodule-config "" s 2>actual && test_i18ngrep "bad config" actual ) '
@@ -55,7 +55,7 @@ EOF test_expect_success 'test parsing and lookup of submodule config by path' ' (cd super && - test-submodule-config \ + test-tool submodule-config \ HEAD^ a \ HEAD b \ HEAD^ submodule \
@@ -67,7 +67,7 @@ test_expect_success 'test parsing and lookup of submodule config by path' ' test_expect_success 'test parsing and lookup of submodule config by name' ' (cd super && - test-submodule-config --name \ + test-tool submodule-config --name \ HEAD^ a \ HEAD a \ HEAD^ submodule \
@@ -89,7 +89,7 @@ test_expect_success 'error in one submodule config lets continue' ' git add .gitmodules && mv .gitmodules.bak .gitmodules && git commit -m "add error" && - test-submodule-config \ + test-tool submodule-config \ HEAD b \ HEAD submodule \ >actual &&
@@ -100,7 +100,7 @@ test_expect_success 'error in one submodule config lets continue' ' test_expect_success 'error message contains blob reference' ' (cd super && sha1=$(git rev-parse HEAD) && - test-submodule-config \ + test-tool submodule-config \ HEAD b \ HEAD submodule \ 2>actual_err &&
@@ -114,9 +114,9 @@ test_expect_success 'using different treeishs works' ' git tag new_tag && tree=$(git rev-parse HEAD^{tree}) && commit=$(git rev-parse HEAD^{commit}) && - test-submodule-config $commit b >expect && - test-submodule-config $tree b >actual.1 && - test-submodule-config new_tag b >actual.2 && + test-tool submodule-config $commit b >expect && + test-tool submodule-config $tree b >actual.1 && + test-tool submodule-config new_tag b >actual.2 && test_cmp expect actual.1 && test_cmp expect actual.2 )
@@ -130,7 +130,7 @@ test_expect_success 'error in history in fetchrecursesubmodule lets continue' ' git config --unset -f .gitmodules \ submodule.submodule.fetchrecursesubmodules && git commit -m "add error in fetchrecursesubmodules" && - test-submodule-config \ + test-tool submodule-config \ HEAD b \ HEAD submodule \ >actual &&
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
PATCH v2 33/36 t/helper: merge test-subprocess into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-subprocess.c | 3 ++- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/t1501-work-tree.sh | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-)
Makefile +1 -1
@@ -683,6 +683,7 @@ TEST_BUILTINS_OBJS += test-sigchain.o TEST_BUILTINS_OBJS += test-strcmp-offset.o TEST_BUILTINS_OBJS += test-string-list.o TEST_BUILTINS_OBJS += test-submodule-config.o +TEST_BUILTINS_OBJS += test-subprocess.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
@@ -690,7 +691,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-subprocess TEST_PROGRAMS_NEED_X += test-svn-fe TEST_PROGRAMS_NEED_X += test-tool TEST_PROGRAMS_NEED_X += test-urlmatch-normalization
t/helper/test-subprocess.c +2 -1
@@ -1,7 +1,8 @@ +#include "test-tool.h" #include "cache.h" #include "run-command.h" -int cmd_main (int argc,const char **argv) +int cmd__subprocess (int argc,const char **argv) {struct child_process cp =CHILD_PROCESS_INIT ;int nogit =0 ;
t/helper/test-tool.c +1 -0
@@ -38,6 +38,7 @@ static struct test_cmd cmds[] = { { "strcmp-offset", cmd__strcmp_offset }, { "string-list", cmd__string_list }, { "submodule-config", cmd__submodule_config }, + { "subprocess", cmd__subprocess }, };int cmd_main (int argc,const char **argv)
t/helper/test-tool.h +1 -0
@@ -32,5 +32,6 @@ int cmd__sigchain(int argc, const char **argv);int cmd__strcmp_offset (int argc,const char **argv);int cmd__string_list (int argc,const char **argv);int cmd__submodule_config (int argc,const char **argv); +int cmd__subprocess (int argc,const char **argv);#endif
t/t1501-work-tree.sh +1 -1
@@ -341,7 +341,7 @@ test_expect_success 'make_relative_path handles double slashes in GIT_DIR' ' test_expect_success 'relative $GIT_WORK_TREE and git subprocesses' ' GIT_DIR=repo.git GIT_WORK_TREE=repo.git/work \ - test-subprocess --setup-work-tree rev-parse --show-toplevel >actual && + test-tool subprocess --setup-work-tree rev-parse --show-toplevel >actual && echo "$(pwd)/repo.git/work" >expected && test_cmp expected actual '
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
PATCH v2 34/36 t/helper: merge test-urlmatch-normalization into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/helper/test-urlmatch-normalization.c | 5 +- t/t0110-urlmatch-normalization.sh | 266 ++++++++++++------------- 5 files changed, 139 insertions(+), 136 deletions(-)
Makefile +1 -1
@@ -684,6 +684,7 @@ TEST_BUILTINS_OBJS += test-strcmp-offset.o TEST_BUILTINS_OBJS += test-string-list.o TEST_BUILTINS_OBJS += test-submodule-config.o TEST_BUILTINS_OBJS += test-subprocess.o +TEST_BUILTINS_OBJS += test-urlmatch-normalization.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
@@ -693,7 +694,6 @@ TEST_PROGRAMS_NEED_X += test-parse-options TEST_PROGRAMS_NEED_X += test-write-cache TEST_PROGRAMS_NEED_X += test-svn-fe TEST_PROGRAMS_NEED_X += test-tool -TEST_PROGRAMS_NEED_X += test-urlmatch-normalization TEST_PROGRAMS_NEED_X += test-wildmatch TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))
t/helper/test-tool.c +1 -0
@@ -39,6 +39,7 @@ static struct test_cmd cmds[] = { { "string-list", cmd__string_list }, { "submodule-config", cmd__submodule_config }, { "subprocess", cmd__subprocess }, + { "urlmatch-normalization", cmd__urlmatch_normalization }, };int cmd_main (int argc,const char **argv)
t/helper/test-tool.h +1 -0
@@ -33,5 +33,6 @@ int cmd__strcmp_offset(int argc, const char **argv);int cmd__string_list (int argc,const char **argv);int cmd__submodule_config (int argc,const char **argv);int cmd__subprocess (int argc,const char **argv); +int cmd__urlmatch_normalization (int argc,const char **argv);#endif
t/helper/test-urlmatch-normalization.c +3 -2
@@ -1,9 +1,10 @@ +#include "test-tool.h" #include "git-compat-util.h" #include "urlmatch.h" -int cmd_main (int argc,const char **argv) +int cmd__urlmatch_normalization (int argc,const char **argv) { -const char usage[] ="test-urlmatch-normalization [-p | -l] <url1> | <url1> <url2>" ; +const char usage[] ="test-tool urlmatch-normalization [-p | -l] <url1> | <url1> <url2>" ;char *url1, *url2;int opt_p =0 , opt_l =0 ;
t/t0110-urlmatch-normalization.sh +133 -133
305 lines not on this page · raw message
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
PATCH v2 35/36 t/helper: merge test-wildmatch into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/helper/test-wildmatch.c | 3 ++- t/t3070-wildmatch.sh | 14 +++++++------- 5 files changed, 12 insertions(+), 9 deletions(-)
Makefile +1 -1
@@ -685,6 +685,7 @@ TEST_BUILTINS_OBJS += test-string-list.o TEST_BUILTINS_OBJS += test-submodule-config.o TEST_BUILTINS_OBJS += test-subprocess.o TEST_BUILTINS_OBJS += test-urlmatch-normalization.o +TEST_BUILTINS_OBJS += test-wildmatch.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
@@ -694,7 +695,6 @@ TEST_PROGRAMS_NEED_X += test-parse-options TEST_PROGRAMS_NEED_X += test-write-cache TEST_PROGRAMS_NEED_X += test-svn-fe TEST_PROGRAMS_NEED_X += test-tool -TEST_PROGRAMS_NEED_X += test-wildmatch TEST_PROGRAMS = $(patsubst %,t/helper/%$X,$(TEST_PROGRAMS_NEED_X))
t/helper/test-tool.c +1 -0
@@ -40,6 +40,7 @@ static struct test_cmd cmds[] = { { "submodule-config", cmd__submodule_config }, { "subprocess", cmd__subprocess }, { "urlmatch-normalization", cmd__urlmatch_normalization }, + { "wildmatch", cmd__wildmatch }, };int cmd_main (int argc,const char **argv)
t/helper/test-tool.h +1 -0
@@ -34,5 +34,6 @@ int cmd__string_list(int argc, const char **argv);int cmd__submodule_config (int argc,const char **argv);int cmd__subprocess (int argc,const char **argv);int cmd__urlmatch_normalization (int argc,const char **argv); +int cmd__wildmatch (int argc,const char **argv);#endif
t/helper/test-wildmatch.c +2 -1
@@ -1,6 +1,7 @@ +#include "test-tool.h" #include "cache.h" -int cmd_main (int argc,const char **argv) +int cmd__wildmatch (int argc,const char **argv) {int i;for (i =2 ; i < argc; i++) {
t/t3070-wildmatch.sh +7 -7
@@ -79,12 +79,12 @@ match_with_function() { if test "$match_expect" = 1 then test_expect_success "$match_function: match '$text' '$pattern'" " - test-wildmatch $match_function '$text' '$pattern' + test-tool wildmatch $match_function '$text' '$pattern' " elif test "$match_expect" = 0 then test_expect_success "$match_function: no match '$text' '$pattern'" " - test_must_fail test-wildmatch $match_function '$text' '$pattern' + test_must_fail test-tool wildmatch $match_function '$text' '$pattern' " else test_expect_success "PANIC: Test framework error. Unknown matches value $match_expect" 'false'
@@ -148,7 +148,7 @@ match_with_ls_files() { match() { if test "$#" = 6 then - # When test-wildmatch and git ls-files produce the same + # When test-tool wildmatch and git ls-files produce the same # result. match_glob=$1 match_file_glob=$match_glob
@@ -204,19 +204,19 @@ match() { fi ' - # $1: Case sensitive glob match: test-wildmatch & ls-files + # $1: Case sensitive glob match: test-tool wildmatch & ls-files match_with_function "$text" "$pattern" $match_glob "wildmatch" match_with_ls_files "$text" "$pattern" $match_file_glob "wildmatch" " --glob-pathspecs" - # $2: Case insensitive glob match: test-wildmatch & ls-files + # $2: Case insensitive glob match: test-tool wildmatch & ls-files match_with_function "$text" "$pattern" $match_iglob "iwildmatch" match_with_ls_files "$text" "$pattern" $match_file_iglob "iwildmatch" " --glob-pathspecs --icase-pathspecs" - # $3: Case sensitive path match: test-wildmatch & ls-files + # $3: Case sensitive path match: test-tool wildmatch & ls-files match_with_function "$text" "$pattern" $match_pathmatch "pathmatch" match_with_ls_files "$text" "$pattern" $match_file_pathmatch "pathmatch" "" - # $4: Case insensitive path match: test-wildmatch & ls-files + # $4: Case insensitive path match: test-tool wildmatch & ls-files match_with_function "$text" "$pattern" $match_pathmatchi "ipathmatch" match_with_ls_files "$text" "$pattern" $match_file_pathmatchi "ipathmatch" " --icase-pathspecs" }
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
PATCH v2 36/36 t/helper: merge test-write-cache into test-tool
In reply to Nguyễn Thái Ngọc Duy--- Makefile | 2 +- t/helper/test-tool.c | 1 + t/helper/test-tool.h | 1 + t/helper/test-write-cache.c | 3 ++- t/perf/p0007-write-cache.sh | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-)
Makefile +1 -1
@@ -686,13 +686,13 @@ TEST_BUILTINS_OBJS += test-submodule-config.o TEST_BUILTINS_OBJS += test-subprocess.o TEST_BUILTINS_OBJS += test-urlmatch-normalization.o TEST_BUILTINS_OBJS += test-wildmatch.o +TEST_BUILTINS_OBJS += test-write-cache.o TEST_PROGRAMS_NEED_X += test-dump-fsmonitor TEST_PROGRAMS_NEED_X += test-dump-untracked-cache 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-svn-fe TEST_PROGRAMS_NEED_X += test-tool
t/helper/test-tool.c +1 -0
@@ -41,6 +41,7 @@ static struct test_cmd cmds[] = { { "subprocess", cmd__subprocess }, { "urlmatch-normalization", cmd__urlmatch_normalization }, { "wildmatch", cmd__wildmatch }, + { "write-cache", cmd__write_cache }, };int cmd_main (int argc,const char **argv)
t/helper/test-tool.h +1 -0
@@ -35,5 +35,6 @@ int cmd__submodule_config(int argc, const char **argv);int cmd__subprocess (int argc,const char **argv);int cmd__urlmatch_normalization (int argc,const char **argv);int cmd__wildmatch (int argc,const char **argv); +int cmd__write_cache (int argc,const char **argv);#endif
t/helper/test-write-cache.c +2 -1
@@ -1,9 +1,10 @@ +#include "test-tool.h" #include "cache.h" #include "lockfile.h" static struct lock_file index_lock; -int cmd_main (int argc,const char **argv) +int cmd__write_cache (int argc,const char **argv) {int i, cnt =1 , lockfd;if (argc ==2 )
t/perf/p0007-write-cache.sh +1 -1
@@ -23,7 +23,7 @@ test_expect_success "setup repo" ' count=3 test_perf "write_locked_index $count times ($nr_files files)" " - test-write-cache $count + test-tool write-cache $count " test_done
Signature · 1 line
2.17.0.rc0.348.gd5a49e0b6f
Quoted 6 lines · Nguyễn Thái Ngọc Duy
v2 fixes a couple of typos in commit messages and use the
cmd__prefix for test commands instead oftest_, which avoids a naming conflict with the existing functiontest_lazy_init_name_hash[the previous v2 send out was aborted because I messed it up with some other patches]
This whole thing looks good to me, and I've applied it to my own build and run several modes (normal, split index etc.) of the test suite with it. Didn't get any problems.
Micronit: If you M-x sort-lines (and I assume similar in other editors that have a function to sort stuff in ASCII order) the test-tool.c list you get this diff on top:
diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c
index cd5e28b045..c38939b93e 100644
--- a/t/helper/test-tool.c
+++ b/t/helper/test-tool.c
@@ -32,8 +32,8 @@ static struct test_cmd cmds[] = {
{ "revision-walking", cmd__revision_walking },
{ "run-command", cmd__run_command },
{ "scrap-cache-tree", cmd__scrap_cache_tree },
- { "sha1-array", cmd__sha1_array },
{ "sha1", cmd__sha1 },
+ { "sha1-array", cmd__sha1_array },
{ "sigchain", cmd__sigchain },
{ "strcmp-offset", cmd__strcmp_offset },
{ "string-list", cmd__string_list },I think it makes sense to keep such lists in ASCII order (" before -) for subsequent edits where one or more things are added to the list and then sorted before submission.
Quoted 33 lines · Ævar Arnfjörð Bjarmason
Quoted 6 lines · Nguyễn Thái Ngọc Duy
v2 fixes a couple of typos in commit messages and use the
cmd__prefix for test commands instead oftest_, which avoids a naming conflict with the existing functiontest_lazy_init_name_hash[the previous v2 send out was aborted because I messed it up with some other patches]
This whole thing looks good to me, and I've applied it to my own build and run several modes (normal, split index etc.) of the test suite with it. Didn't get any problems.
Micronit: If you M-x sort-lines (and I assume similar in other editors that have a function to sort stuff in ASCII order) the
test-tool.clist you get this diff on top:diff --git a/t/helper/test-tool.c b/t/helper/test-tool.c index cd5e28b045..c38939b93e 100644 --- a/t/helper/test-tool.c +++ b/t/helper/test-tool.c @@ -32,8 +32,8 @@ static struct test_cmd cmds[] = { { "revision-walking", cmd__revision_walking }, { "run-command", cmd__run_command }, { "scrap-cache-tree", cmd__scrap_cache_tree }, - { "sha1-array", cmd__sha1_array }, { "sha1", cmd__sha1 }, + { "sha1-array", cmd__sha1_array }, { "sigchain", cmd__sigchain }, { "strcmp-offset", cmd__strcmp_offset }, { "string-list", cmd__string_list },
Quoted 3 lines
I think it makes sense to keep such lists in ASCII order (" before -) for subsequent edits where one or more things are added to the list and then sorted before submission.
Yeah, my brain just failed to see that sha1-array should be behind sha1. Bad brain!
Signature · 1 line
Duy
Quoted 6 lines · Nguyễn Thái Ngọc Duy
v2 fixes a couple of typos in commit messages and use the
cmd__prefix for test commands instead oftest_, which avoids a naming conflict with the existing functiontest_lazy_init_name_hash[the previous v2 send out was aborted because I messed it up with some other patches]
Yeah, I was wondering if the 7 v4 patches for --keep-pack should be picked up, or I should just wait for a proper resubmission under its own cover letter.
Hi Duy,
Quoted 6 lines · Nguyễn Thái Ngọc Duy
v2 fixes a couple of typos in commit messages and use the
cmd__prefix for test commands instead oftest_, which avoids a naming conflict with the existing functiontest_lazy_init_name_hash[the previous v2 send out was aborted because I messed it up with some other patches]
This iteration, with the SQUASH??? I proposed (and that Junio will hopefully pick up soon), works well on Windows.
Thank you,
Dscho
Quoted 2 lines · Johannes Schindelin
This iteration, with the SQUASH??? I proposed (and that Junio will hopefully pick up soon), works well on Windows.
Thanks; is that the "call it fn, as main is macro-ed away by us?" change?
Hi Junio,
Quoted 7 lines · Junio C Hamano
Quoted 2 lines · Johannes Schindelin
This iteration, with the SQUASH??? I proposed (and that Junio will hopefully pick up soon), works well on Windows.
Thanks; is that the "call it fn, as main is macro-ed away by us?" change?
Precisely.
Thanks,
Dscho