{"thread":{"id":"49307","subject":"[PATCH 0/6] Merge remaining t/helper binaries to test-tool","startedAt":"2018-09-09T17:36:41Z","lastAt":"2018-09-10T03:11:54Z","messageCount":10,"participants":["Nguyễn Thái Ngọc Duy","Ævar Arnfjörð Bjarmason","Duy Nguyen","brian m. carlson"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"357764","messageId":"20180909173631.1446-1-pclouds@gmail.com","threadId":"49307","inReplyTo":null,"subject":"[PATCH 0/6] Merge remaining t/helper binaries to test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-09-09T17:36:25Z","receivedAt":"2018-09-09T17:36:41Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Last time when I added test-tool in 27f25845cf (Merge branch\n'nd/combined-test-helper' - 2018-04-11) I left out a few test programs\nbecause there were a couple in-flight new tests that used them. All\nthose topics are merged now. So we can merge these to test-tool and\ncall it done.\n\nNguyễn Thái Ngọc Duy (6):\n  t/helper: keep test-tool command list sorted\n  t/helper: merge test-dump-untracked-cache into test-tool\n  t/helper: merge test-pkt-line into test-tool\n  t/helper: merge test-parse-options into test-tool\n  t/helper: merge test-dump-fsmonitor into test-tool\n  Makefile: add a hint about TEST_BUILTINS_OBJS\n\n Makefile                             | 12 +++--\n t/helper/test-dump-fsmonitor.c       |  3 +-\n t/helper/test-dump-untracked-cache.c |  3 +-\n t/helper/test-parse-options.c        |  5 +-\n t/helper/test-pkt-line.c             |  3 +-\n t/helper/test-tool.c                 |  6 ++-\n t/helper/test-tool.h                 |  6 ++-\n t/t0040-parse-options.sh             | 70 ++++++++++++++--------------\n t/t5701-git-serve.sh                 | 36 +++++++-------\n t/t5702-protocol-v2.sh               |  2 +-\n t/t5703-upload-pack-ref-in-want.sh   | 14 +++---\n t/t7063-status-untracked-cache.sh    | 68 +++++++++++++--------------\n t/t7519-status-fsmonitor.sh          | 14 +++---\n 13 files changed, 128 insertions(+), 114 deletions(-)\n\n-- \n2.19.0.rc0.337.ge906d732e7\n\n"},{"id":"357765","messageId":"20180909173631.1446-2-pclouds@gmail.com","threadId":"49307","inReplyTo":"20180909173631.1446-1-pclouds@gmail.com","subject":"[PATCH 1/6] t/helper: keep test-tool command list sorted","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-09-09T17:36:26Z","receivedAt":"2018-09-09T17:36:41Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile             | 2 +-\n t/helper/test-tool.c | 2 +-\n t/helper/test-tool.h | 2 +-\n 3 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 5a969f5830..1208584fa1 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -729,8 +729,8 @@ TEST_BUILTINS_OBJS += test-repository.o\n TEST_BUILTINS_OBJS += test-revision-walking.o\n TEST_BUILTINS_OBJS += test-run-command.o\n TEST_BUILTINS_OBJS += test-scrap-cache-tree.o\n-TEST_BUILTINS_OBJS += test-sha1-array.o\n TEST_BUILTINS_OBJS += test-sha1.o\n+TEST_BUILTINS_OBJS += test-sha1-array.o\n TEST_BUILTINS_OBJS += test-sigchain.o\n TEST_BUILTINS_OBJS += test-strcmp-offset.o\n TEST_BUILTINS_OBJS += test-string-list.o\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 0edafcfd65..79e03eecb5 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -34,8 +34,8 @@ static struct test_cmd cmds[] = {\n \t{ \"revision-walking\", cmd__revision_walking },\n \t{ \"run-command\", cmd__run_command },\n \t{ \"scrap-cache-tree\", cmd__scrap_cache_tree },\n-\t{ \"sha1-array\", cmd__sha1_array },\n \t{ \"sha1\", cmd__sha1 },\n+\t{ \"sha1-array\", cmd__sha1_array },\n \t{ \"sigchain\", cmd__sigchain },\n \t{ \"strcmp-offset\", cmd__strcmp_offset },\n \t{ \"string-list\", cmd__string_list },\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex e954e8c522..4b7212827a 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -30,8 +30,8 @@ int cmd__repository(int argc, const char **argv);\n int cmd__revision_walking(int argc, const char **argv);\n int cmd__run_command(int argc, const char **argv);\n int cmd__scrap_cache_tree(int argc, const char **argv);\n-int cmd__sha1_array(int argc, const char **argv);\n int cmd__sha1(int argc, const char **argv);\n+int cmd__sha1_array(int argc, const char **argv);\n int cmd__sigchain(int argc, const char **argv);\n int cmd__strcmp_offset(int argc, const char **argv);\n int cmd__string_list(int argc, const char **argv);\n-- \n2.19.0.rc0.337.ge906d732e7\n\n"},{"id":"357766","messageId":"20180909173631.1446-3-pclouds@gmail.com","threadId":"49307","inReplyTo":"20180909173631.1446-1-pclouds@gmail.com","subject":"[PATCH 2/6] t/helper: merge test-dump-untracked-cache into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-09-09T17:36:27Z","receivedAt":"2018-09-09T17:36:46Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                             |  2 +-\n t/helper/test-dump-untracked-cache.c |  3 +-\n t/helper/test-tool.c                 |  1 +\n t/helper/test-tool.h                 |  1 +\n t/t7063-status-untracked-cache.sh    | 68 ++++++++++++++--------------\n t/t7519-status-fsmonitor.sh          |  4 +-\n 6 files changed, 41 insertions(+), 38 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 1208584fa1..fa67d76780 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -710,6 +710,7 @@ TEST_BUILTINS_OBJS += test-delta.o\n TEST_BUILTINS_OBJS += test-drop-caches.o\n TEST_BUILTINS_OBJS += test-dump-cache-tree.o\n TEST_BUILTINS_OBJS += test-dump-split-index.o\n+TEST_BUILTINS_OBJS += test-dump-untracked-cache.o\n TEST_BUILTINS_OBJS += test-example-decorate.o\n TEST_BUILTINS_OBJS += test-genrandom.o\n TEST_BUILTINS_OBJS += test-hashmap.o\n@@ -741,7 +742,6 @@ TEST_BUILTINS_OBJS += test-wildmatch.o\n TEST_BUILTINS_OBJS += test-write-cache.o\n \n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n-TEST_PROGRAMS_NEED_X += test-dump-untracked-cache\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\ndiff --git a/t/helper/test-dump-untracked-cache.c b/t/helper/test-dump-untracked-cache.c\nindex bd92fb305a..52870ebbb3 100644\n--- a/t/helper/test-dump-untracked-cache.c\n+++ b/t/helper/test-dump-untracked-cache.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"dir.h\"\n \n@@ -38,7 +39,7 @@ static void dump(struct untracked_cache_dir *ucd, struct strbuf *base)\n \tstrbuf_setlen(base, len);\n }\n \n-int cmd_main(int ac, const char **av)\n+int cmd__dump_untracked_cache(int ac, const char **av)\n {\n \tstruct untracked_cache *uc;\n \tstruct strbuf base = STRBUF_INIT;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 79e03eecb5..820335704a 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -15,6 +15,7 @@ static struct test_cmd cmds[] = {\n \t{ \"drop-caches\", cmd__drop_caches },\n \t{ \"dump-cache-tree\", cmd__dump_cache_tree },\n \t{ \"dump-split-index\", cmd__dump_split_index },\n+\t{ \"dump-untracked-cache\", cmd__dump_untracked_cache },\n \t{ \"example-decorate\", cmd__example_decorate },\n \t{ \"genrandom\", cmd__genrandom },\n \t{ \"hashmap\", cmd__hashmap },\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 4b7212827a..118c700c7a 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -11,6 +11,7 @@ int cmd__delta(int argc, const char **argv);\n int cmd__drop_caches(int argc, const char **argv);\n int cmd__dump_cache_tree(int argc, const char **argv);\n int cmd__dump_split_index(int argc, const char **argv);\n+int cmd__dump_untracked_cache(int argc, const char **argv);\n int cmd__example_decorate(int argc, const char **argv);\n int cmd__genrandom(int argc, const char **argv);\n int cmd__hashmap(int argc, const char **argv);\ndiff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh\nindex 2da57fce7b..190ae149cf 100755\n--- a/t/t7063-status-untracked-cache.sh\n+++ b/t/t7063-status-untracked-cache.sh\n@@ -55,7 +55,7 @@ test_expect_success 'setup' '\n '\n \n test_expect_success 'untracked cache is empty' '\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect-empty <<EOF &&\n info/exclude 0000000000000000000000000000000000000000\n core.excludesfile 0000000000000000000000000000000000000000\n@@ -106,7 +106,7 @@ EOF\n '\n \n test_expect_success 'untracked cache after first status' '\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \ttest_cmp ../dump.expect ../actual\n '\n \n@@ -126,7 +126,7 @@ EOF\n '\n \n test_expect_success 'untracked cache after second status' '\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \ttest_cmp ../dump.expect ../actual\n '\n \n@@ -157,7 +157,7 @@ EOF\n '\n \n test_expect_success 'verify untracked cache dump' '\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n info/exclude $EMPTY_BLOB\n core.excludesfile 0000000000000000000000000000000000000000\n@@ -204,7 +204,7 @@ EOF\n '\n \n test_expect_success 'verify untracked cache dump' '\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n info/exclude $EMPTY_BLOB\n core.excludesfile 0000000000000000000000000000000000000000\n@@ -248,7 +248,7 @@ EOF\n '\n \n test_expect_success 'verify untracked cache dump' '\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n core.excludesfile 0000000000000000000000000000000000000000\n@@ -267,7 +267,7 @@ EOF\n \n test_expect_success 'move two from tracked to untracked' '\n \tgit rm --cached two &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n core.excludesfile 0000000000000000000000000000000000000000\n@@ -304,7 +304,7 @@ EOF\n '\n \n test_expect_success 'verify untracked cache dump' '\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n core.excludesfile 0000000000000000000000000000000000000000\n@@ -324,7 +324,7 @@ EOF\n \n test_expect_success 'move two from untracked to tracked' '\n \tgit add two &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n core.excludesfile 0000000000000000000000000000000000000000\n@@ -361,7 +361,7 @@ EOF\n '\n \n test_expect_success 'verify untracked cache dump' '\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n core.excludesfile 0000000000000000000000000000000000000000\n@@ -405,7 +405,7 @@ EOF\n '\n \n test_expect_success 'untracked cache correct after commit' '\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n core.excludesfile 0000000000000000000000000000000000000000\n@@ -464,7 +464,7 @@ EOF\n '\n \n test_expect_success 'untracked cache correct after status' '\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect <<EOF &&\n info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n core.excludesfile 0000000000000000000000000000000000000000\n@@ -532,7 +532,7 @@ EOF\n '\n \n test_expect_success 'verify untracked cache dump (sparse/subdirs)' '\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \tcat >../expect-from-test-dump <<EOF &&\n info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0\n core.excludesfile 0000000000000000000000000000000000000000\n@@ -598,66 +598,66 @@ EOF\n \n test_expect_success '--no-untracked-cache removes the cache' '\n \tgit update-index --no-untracked-cache &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \techo \"no untracked cache\" >../expect-no-uc &&\n \ttest_cmp ../expect-no-uc ../actual\n '\n \n test_expect_success 'git status does not change anything' '\n \tgit status &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \ttest_cmp ../expect-no-uc ../actual\n '\n \n test_expect_success 'setting core.untrackedCache to true and using git status creates the cache' '\n \tgit config core.untrackedCache true &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \ttest_cmp ../expect-no-uc ../actual &&\n \tgit status &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \ttest_cmp ../expect-from-test-dump ../actual\n '\n \n test_expect_success 'using --no-untracked-cache does not fail when core.untrackedCache is true' '\n \tgit update-index --no-untracked-cache &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \ttest_cmp ../expect-no-uc ../actual &&\n \tgit update-index --untracked-cache &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \ttest_cmp ../expect-empty ../actual\n '\n \n test_expect_success 'setting core.untrackedCache to false and using git status removes the cache' '\n \tgit config core.untrackedCache false &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \ttest_cmp ../expect-empty ../actual &&\n \tgit status &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \ttest_cmp ../expect-no-uc ../actual\n '\n \n test_expect_success 'using --untracked-cache does not fail when core.untrackedCache is false' '\n \tgit update-index --untracked-cache &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \ttest_cmp ../expect-empty ../actual\n '\n \n test_expect_success 'setting core.untrackedCache to keep' '\n \tgit config core.untrackedCache keep &&\n \tgit update-index --untracked-cache &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \ttest_cmp ../expect-empty ../actual &&\n \tgit status &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \ttest_cmp ../expect-from-test-dump ../actual &&\n \tgit update-index --no-untracked-cache &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \ttest_cmp ../expect-no-uc ../actual &&\n \tgit update-index --force-untracked-cache &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \ttest_cmp ../expect-empty ../actual &&\n \tgit status &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \ttest_cmp ../expect-from-test-dump ../actual\n '\n \n@@ -671,23 +671,23 @@ test_expect_success 'test ident field is working' '\n \n test_expect_success 'untracked cache survives a checkout' '\n \tgit commit --allow-empty -m empty &&\n-\ttest-dump-untracked-cache >../before &&\n+\ttest-tool dump-untracked-cache >../before &&\n \ttest_when_finished  \"git checkout master\" &&\n \tgit checkout -b other_branch &&\n-\ttest-dump-untracked-cache >../after &&\n+\ttest-tool dump-untracked-cache >../after &&\n \ttest_cmp ../before ../after &&\n \ttest_commit test &&\n-\ttest-dump-untracked-cache >../before &&\n+\ttest-tool dump-untracked-cache >../before &&\n \tgit checkout master &&\n-\ttest-dump-untracked-cache >../after &&\n+\ttest-tool dump-untracked-cache >../after &&\n \ttest_cmp ../before ../after\n '\n \n test_expect_success 'untracked cache survives a commit' '\n-\ttest-dump-untracked-cache >../before &&\n+\ttest-tool dump-untracked-cache >../before &&\n \tgit add done/two &&\n \tgit commit -m commit &&\n-\ttest-dump-untracked-cache >../after &&\n+\ttest-tool dump-untracked-cache >../after &&\n \ttest_cmp ../before ../after\n '\n \n@@ -751,7 +751,7 @@ test_expect_success '\"status\" after file replacement should be clean with UC=tru\n \tgit checkout master &&\n \tavoid_racy &&\n \tstatus_is_clean &&\n-\ttest-dump-untracked-cache >../actual &&\n+\ttest-tool dump-untracked-cache >../actual &&\n \tgrep -F \"recurse valid\" ../actual >../actual.grep &&\n \tcat >../expect.grep <<EOF &&\n / 0000000000000000000000000000000000000000 recurse valid\ndiff --git a/t/t7519-status-fsmonitor.sh b/t/t7519-status-fsmonitor.sh\nindex 756beb0d8e..603d27789b 100755\n--- a/t/t7519-status-fsmonitor.sh\n+++ b/t/t7519-status-fsmonitor.sh\n@@ -333,7 +333,7 @@ test_expect_success UNTRACKED_CACHE 'ignore .git changes when invalidating UNTR'\n \t\tgit update-index --fsmonitor &&\n \t\tGIT_TRACE_UNTRACKED_STATS=\"$TRASH_DIRECTORY/trace-before\" \\\n \t\tgit status &&\n-\t\ttest-dump-untracked-cache >../before\n+\t\ttest-tool dump-untracked-cache >../before\n \t) &&\n \tcat >>dot-git/.git/hooks/fsmonitor-test <<-\\EOF &&\n \tprintf \".git\\0\"\n@@ -345,7 +345,7 @@ test_expect_success UNTRACKED_CACHE 'ignore .git changes when invalidating UNTR'\n \t\tcd dot-git &&\n \t\tGIT_TRACE_UNTRACKED_STATS=\"$TRASH_DIRECTORY/trace-after\" \\\n \t\tgit status &&\n-\t\ttest-dump-untracked-cache >../after\n+\t\ttest-tool dump-untracked-cache >../after\n \t) &&\n \tgrep \"directory invalidation\" trace-before >>before &&\n \tgrep \"directory invalidation\" trace-after >>after &&\n-- \n2.19.0.rc0.337.ge906d732e7\n\n"},{"id":"357767","messageId":"20180909173631.1446-4-pclouds@gmail.com","threadId":"49307","inReplyTo":"20180909173631.1446-1-pclouds@gmail.com","subject":"[PATCH 3/6] t/helper: merge test-pkt-line into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-09-09T17:36:28Z","receivedAt":"2018-09-09T17:36:46Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                           |  2 +-\n t/helper/test-pkt-line.c           |  3 ++-\n t/helper/test-tool.c               |  1 +\n t/helper/test-tool.h               |  1 +\n t/t5701-git-serve.sh               | 36 +++++++++++++++---------------\n t/t5702-protocol-v2.sh             |  2 +-\n t/t5703-upload-pack-ref-in-want.sh | 14 ++++++------\n 7 files changed, 31 insertions(+), 28 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex fa67d76780..d9a4029895 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -722,6 +722,7 @@ TEST_BUILTINS_OBJS += test-mergesort.o\n TEST_BUILTINS_OBJS += test-mktemp.o\n TEST_BUILTINS_OBJS += test-online-cpus.o\n TEST_BUILTINS_OBJS += test-path-utils.o\n+TEST_BUILTINS_OBJS += test-pkt-line.o\n TEST_BUILTINS_OBJS += test-prio-queue.o\n TEST_BUILTINS_OBJS += test-read-cache.o\n TEST_BUILTINS_OBJS += test-ref-store.o\n@@ -745,7 +746,6 @@ TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-parse-options\n-TEST_PROGRAMS_NEED_X += test-pkt-line\n TEST_PROGRAMS_NEED_X += test-svn-fe\n TEST_PROGRAMS_NEED_X += test-tool\n \ndiff --git a/t/helper/test-pkt-line.c b/t/helper/test-pkt-line.c\nindex 30775f986f..282d536384 100644\n--- a/t/helper/test-pkt-line.c\n+++ b/t/helper/test-pkt-line.c\n@@ -1,4 +1,5 @@\n #include \"cache.h\"\n+#include \"test-tool.h\"\n #include \"pkt-line.h\"\n \n static void pack_line(const char *line)\n@@ -79,7 +80,7 @@ static void unpack_sideband(void)\n \t}\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__pkt_line(int argc, const char **argv)\n {\n \tif (argc < 2)\n \t\tdie(\"too few arguments\");\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 820335704a..0ef53152c4 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -27,6 +27,7 @@ static struct test_cmd cmds[] = {\n \t{ \"mktemp\", cmd__mktemp },\n \t{ \"online-cpus\", cmd__online_cpus },\n \t{ \"path-utils\", cmd__path_utils },\n+\t{ \"pkt-line\", cmd__pkt_line },\n \t{ \"prio-queue\", cmd__prio_queue },\n \t{ \"read-cache\", cmd__read_cache },\n \t{ \"ref-store\", cmd__ref_store },\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 118c700c7a..7a0ac22ef7 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -23,6 +23,7 @@ int cmd__mergesort(int argc, const char **argv);\n int cmd__mktemp(int argc, const char **argv);\n int cmd__online_cpus(int argc, const char **argv);\n int cmd__path_utils(int argc, const char **argv);\n+int cmd__pkt_line(int argc, const char **argv);\n int cmd__prio_queue(int argc, const char **argv);\n int cmd__read_cache(int argc, const char **argv);\n int cmd__ref_store(int argc, const char **argv);\ndiff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh\nindex 75ec79e6cb..29a54fbfff 100755\n--- a/t/t5701-git-serve.sh\n+++ b/t/t5701-git-serve.sh\n@@ -15,13 +15,13 @@ test_expect_success 'test capability advertisement' '\n \tEOF\n \n \tgit serve --advertise-capabilities >out &&\n-\ttest-pkt-line unpack <out >actual &&\n+\ttest-tool pkt-line unpack <out >actual &&\n \ttest_cmp actual expect\n '\n \n test_expect_success 'stateless-rpc flag does not list capabilities' '\n \t# Empty request\n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \t0000\n \tEOF\n \tgit serve --stateless-rpc >out <in &&\n@@ -33,7 +33,7 @@ test_expect_success 'stateless-rpc flag does not list capabilities' '\n '\n \n test_expect_success 'request invalid capability' '\n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tfoobar\n \t0000\n \tEOF\n@@ -42,7 +42,7 @@ test_expect_success 'request invalid capability' '\n '\n \n test_expect_success 'request with no command' '\n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tagent=git/test\n \t0000\n \tEOF\n@@ -51,7 +51,7 @@ test_expect_success 'request with no command' '\n '\n \n test_expect_success 'request invalid command' '\n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tcommand=foo\n \tagent=git/test\n \t0000\n@@ -71,7 +71,7 @@ test_expect_success 'setup some refs and tags' '\n '\n \n test_expect_success 'basics of ls-refs' '\n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tcommand=ls-refs\n \t0000\n \tEOF\n@@ -88,12 +88,12 @@ test_expect_success 'basics of ls-refs' '\n \tEOF\n \n \tgit serve --stateless-rpc <in >out &&\n-\ttest-pkt-line unpack <out >actual &&\n+\ttest-tool pkt-line unpack <out >actual &&\n \ttest_cmp actual expect\n '\n \n test_expect_success 'basic ref-prefixes' '\n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tcommand=ls-refs\n \t0001\n \tref-prefix refs/heads/master\n@@ -108,12 +108,12 @@ test_expect_success 'basic ref-prefixes' '\n \tEOF\n \n \tgit serve --stateless-rpc <in >out &&\n-\ttest-pkt-line unpack <out >actual &&\n+\ttest-tool pkt-line unpack <out >actual &&\n \ttest_cmp actual expect\n '\n \n test_expect_success 'refs/heads prefix' '\n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tcommand=ls-refs\n \t0001\n \tref-prefix refs/heads/\n@@ -128,12 +128,12 @@ test_expect_success 'refs/heads prefix' '\n \tEOF\n \n \tgit serve --stateless-rpc <in >out &&\n-\ttest-pkt-line unpack <out >actual &&\n+\ttest-tool pkt-line unpack <out >actual &&\n \ttest_cmp actual expect\n '\n \n test_expect_success 'peel parameter' '\n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tcommand=ls-refs\n \t0001\n \tpeel\n@@ -149,12 +149,12 @@ test_expect_success 'peel parameter' '\n \tEOF\n \n \tgit serve --stateless-rpc <in >out &&\n-\ttest-pkt-line unpack <out >actual &&\n+\ttest-tool pkt-line unpack <out >actual &&\n \ttest_cmp actual expect\n '\n \n test_expect_success 'symrefs parameter' '\n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tcommand=ls-refs\n \t0001\n \tsymrefs\n@@ -170,12 +170,12 @@ test_expect_success 'symrefs parameter' '\n \tEOF\n \n \tgit serve --stateless-rpc <in >out &&\n-\ttest-pkt-line unpack <out >actual &&\n+\ttest-tool pkt-line unpack <out >actual &&\n \ttest_cmp actual expect\n '\n \n test_expect_success 'sending server-options' '\n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tcommand=ls-refs\n \tserver-option=hello\n \tserver-option=world\n@@ -190,14 +190,14 @@ test_expect_success 'sending server-options' '\n \tEOF\n \n \tgit serve --stateless-rpc <in >out &&\n-\ttest-pkt-line unpack <out >actual &&\n+\ttest-tool pkt-line unpack <out >actual &&\n \ttest_cmp actual expect\n '\n \n test_expect_success 'unexpected lines are not allowed in fetch request' '\n \tgit init server &&\n \n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tcommand=fetch\n \t0001\n \tthis-is-not-a-command\ndiff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh\nindex 3beeed4546..88a886975d 100755\n--- a/t/t5702-protocol-v2.sh\n+++ b/t/t5702-protocol-v2.sh\n@@ -334,7 +334,7 @@ test_expect_success 'even with handcrafted request, filter does not work if not\n \tgit -C server config uploadpack.allowfilter 0 &&\n \n \t# Custom request that tries to filter even though it is not advertised.\n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tcommand=fetch\n \t0001\n \twant $(git -C server rev-parse master)\ndiff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh\nindex d1ccc22331..3f58f05cbb 100755\n--- a/t/t5703-upload-pack-ref-in-want.sh\n+++ b/t/t5703-upload-pack-ref-in-want.sh\n@@ -9,14 +9,14 @@ get_actual_refs () {\n \t\t/wanted-refs/d\n \t\t/0001/d\n \t\tp\n-\t\t}' <out | test-pkt-line unpack >actual_refs\n+\t\t}' <out | test-tool pkt-line unpack >actual_refs\n }\n \n get_actual_commits () {\n \tsed -n -e '/packfile/,/0000/{\n \t\t/packfile/d\n \t\tp\n-\t\t}' <out | test-pkt-line unpack-sideband >o.pack &&\n+\t\t}' <out | test-tool pkt-line unpack-sideband >o.pack &&\n \tgit index-pack o.pack &&\n \tgit verify-pack -v o.idx | grep commit | cut -c-40 | sort >actual_commits\n }\n@@ -61,7 +61,7 @@ test_expect_success 'config controls ref-in-want advertisement' '\n '\n \n test_expect_success 'invalid want-ref line' '\n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tcommand=fetch\n \t0001\n \tno-progress\n@@ -80,7 +80,7 @@ test_expect_success 'basic want-ref' '\n \tEOF\n \tgit rev-parse f | sort >expected_commits &&\n \n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tcommand=fetch\n \t0001\n \tno-progress\n@@ -101,7 +101,7 @@ test_expect_success 'multiple want-ref lines' '\n \tEOF\n \tgit rev-parse c d | sort >expected_commits &&\n \n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tcommand=fetch\n \t0001\n \tno-progress\n@@ -122,7 +122,7 @@ test_expect_success 'mix want and want-ref' '\n \tEOF\n \tgit rev-parse e f | sort >expected_commits &&\n \n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tcommand=fetch\n \t0001\n \tno-progress\n@@ -143,7 +143,7 @@ test_expect_success 'want-ref with ref we already have commit for' '\n \tEOF\n \t>expected_commits &&\n \n-\ttest-pkt-line pack >in <<-EOF &&\n+\ttest-tool pkt-line pack >in <<-EOF &&\n \tcommand=fetch\n \t0001\n \tno-progress\n-- \n2.19.0.rc0.337.ge906d732e7\n\n"},{"id":"357768","messageId":"20180909173631.1446-5-pclouds@gmail.com","threadId":"49307","inReplyTo":"20180909173631.1446-1-pclouds@gmail.com","subject":"[PATCH 4/6] t/helper: merge test-parse-options into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-09-09T17:36:29Z","receivedAt":"2018-09-09T17:36:46Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                      |  2 +-\n t/helper/test-parse-options.c |  5 ++-\n t/helper/test-tool.c          |  1 +\n t/helper/test-tool.h          |  1 +\n t/t0040-parse-options.sh      | 70 +++++++++++++++++------------------\n 5 files changed, 41 insertions(+), 38 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex d9a4029895..1a8a7cb82d 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -721,6 +721,7 @@ TEST_BUILTINS_OBJS += test-match-trees.o\n TEST_BUILTINS_OBJS += test-mergesort.o\n TEST_BUILTINS_OBJS += test-mktemp.o\n TEST_BUILTINS_OBJS += test-online-cpus.o\n+TEST_BUILTINS_OBJS += test-parse-options.o\n TEST_BUILTINS_OBJS += test-path-utils.o\n TEST_BUILTINS_OBJS += test-pkt-line.o\n TEST_BUILTINS_OBJS += test-prio-queue.o\n@@ -745,7 +746,6 @@ TEST_BUILTINS_OBJS += test-write-cache.o\n TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n-TEST_PROGRAMS_NEED_X += test-parse-options\n TEST_PROGRAMS_NEED_X += test-svn-fe\n TEST_PROGRAMS_NEED_X += test-tool\n \ndiff --git a/t/helper/test-parse-options.c b/t/helper/test-parse-options.c\nindex 630c76d127..9cb8a0ea0f 100644\n--- a/t/helper/test-parse-options.c\n+++ b/t/helper/test-parse-options.c\n@@ -1,3 +1,4 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n #include \"parse-options.h\"\n #include \"string-list.h\"\n@@ -94,11 +95,11 @@ static void show(struct string_list *expect, int *status, const char *fmt, ...)\n \tstrbuf_release(&buf);\n }\n \n-int cmd_main(int argc, const char **argv)\n+int cmd__parse_options(int argc, const char **argv)\n {\n \tconst char *prefix = \"prefix/\";\n \tconst char *usage[] = {\n-\t\t\"test-parse-options <options>\",\n+\t\t\"test-tool parse-options <options>\",\n \t\t\"\",\n \t\t\"A helper function for the parse-options API.\",\n \t\tNULL\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 0ef53152c4..9cc21024e9 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -26,6 +26,7 @@ static struct test_cmd cmds[] = {\n \t{ \"mergesort\", cmd__mergesort },\n \t{ \"mktemp\", cmd__mktemp },\n \t{ \"online-cpus\", cmd__online_cpus },\n+\t{ \"parse-options\", cmd__parse_options },\n \t{ \"path-utils\", cmd__path_utils },\n \t{ \"pkt-line\", cmd__pkt_line },\n \t{ \"prio-queue\", cmd__prio_queue },\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 7a0ac22ef7..527722f4b0 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -22,6 +22,7 @@ int cmd__match_trees(int argc, const char **argv);\n int cmd__mergesort(int argc, const char **argv);\n int cmd__mktemp(int argc, const char **argv);\n int cmd__online_cpus(int argc, const char **argv);\n+int cmd__parse_options(int argc, const char **argv);\n int cmd__path_utils(int argc, const char **argv);\n int cmd__pkt_line(int argc, const char **argv);\n int cmd__prio_queue(int argc, const char **argv);\ndiff --git a/t/t0040-parse-options.sh b/t/t0040-parse-options.sh\nindex 5b0560fa20..17d0c18feb 100755\n--- a/t/t0040-parse-options.sh\n+++ b/t/t0040-parse-options.sh\n@@ -8,7 +8,7 @@ test_description='our own option parser'\n . ./test-lib.sh\n \n cat >expect <<\\EOF\n-usage: test-parse-options <options>\n+usage: test-tool parse-options <options>\n \n     A helper function for the parse-options API.\n \n@@ -52,7 +52,7 @@ Standard options\n EOF\n \n test_expect_success 'test help' '\n-\ttest_must_fail test-parse-options -h >output 2>output.err &&\n+\ttest_must_fail test-tool parse-options -h >output 2>output.err &&\n \ttest_must_be_empty output.err &&\n \ttest_i18ncmp expect output\n '\n@@ -64,7 +64,7 @@ check () {\n \tshift &&\n \texpect=\"$1\" &&\n \tshift &&\n-\ttest-parse-options --expect=\"$what $expect\" \"$@\"\n+\ttest-tool parse-options --expect=\"$what $expect\" \"$@\"\n }\n \n check_unknown_i18n() {\n@@ -75,7 +75,7 @@ check_unknown_i18n() {\n \t\techo error: unknown switch \\`${1#-}\\' >expect ;;\n \tesac &&\n \tcat expect.err >>expect &&\n-\ttest_must_fail test-parse-options $* >output 2>output.err &&\n+\ttest_must_fail test-tool parse-options $* >output 2>output.err &&\n \ttest_must_be_empty output &&\n \ttest_i18ncmp expect output.err\n }\n@@ -133,7 +133,7 @@ file: prefix/my.file\n EOF\n \n test_expect_success 'short options' '\n-\ttest-parse-options -s123 -b -i 1729 -m 16k -b -vv -n -F my.file \\\n+\ttest-tool parse-options -s123 -b -i 1729 -m 16k -b -vv -n -F my.file \\\n \t>output 2>output.err &&\n \ttest_cmp expect output &&\n \ttest_must_be_empty output.err\n@@ -153,7 +153,7 @@ file: prefix/fi.le\n EOF\n \n test_expect_success 'long options' '\n-\ttest-parse-options --boolean --integer 1729 --magnitude 16k \\\n+\ttest-tool parse-options --boolean --integer 1729 --magnitude 16k \\\n \t\t--boolean --string2=321 --verbose --verbose --no-dry-run \\\n \t\t--abbrev=10 --file fi.le --obsolete \\\n \t\t>output 2>output.err &&\n@@ -162,9 +162,9 @@ test_expect_success 'long options' '\n '\n \n test_expect_success 'missing required value' '\n-\ttest_expect_code 129 test-parse-options -s &&\n-\ttest_expect_code 129 test-parse-options --string &&\n-\ttest_expect_code 129 test-parse-options --file\n+\ttest_expect_code 129 test-tool parse-options -s &&\n+\ttest_expect_code 129 test-tool parse-options --string &&\n+\ttest_expect_code 129 test-tool parse-options --file\n '\n \n cat >expect <<\\EOF\n@@ -184,7 +184,7 @@ arg 02: --boolean\n EOF\n \n test_expect_success 'intermingled arguments' '\n-\ttest-parse-options a1 --string 123 b1 --boolean -j 13 -- --boolean \\\n+\ttest-tool parse-options a1 --string 123 b1 --boolean -j 13 -- --boolean \\\n \t\t>output 2>output.err &&\n \ttest_must_be_empty output.err &&\n \ttest_cmp expect output\n@@ -204,21 +204,21 @@ file: (not set)\n EOF\n \n test_expect_success 'unambiguously abbreviated option' '\n-\ttest-parse-options --int 2 --boolean --no-bo >output 2>output.err &&\n+\ttest-tool parse-options --int 2 --boolean --no-bo >output 2>output.err &&\n \ttest_must_be_empty output.err &&\n \ttest_cmp expect output\n '\n \n test_expect_success 'unambiguously abbreviated option with \"=\"' '\n-\ttest-parse-options --expect=\"integer: 2\" --int=2\n+\ttest-tool parse-options --expect=\"integer: 2\" --int=2\n '\n \n test_expect_success 'ambiguously abbreviated option' '\n-\ttest_expect_code 129 test-parse-options --strin 123\n+\ttest_expect_code 129 test-tool parse-options --strin 123\n '\n \n test_expect_success 'non ambiguous option (after two options it abbreviates)' '\n-\ttest-parse-options --expect=\"string: 123\" --st 123\n+\ttest-tool parse-options --expect=\"string: 123\" --st 123\n '\n \n cat >typo.err <<\\EOF\n@@ -226,7 +226,7 @@ error: did you mean `--boolean` (with two dashes ?)\n EOF\n \n test_expect_success 'detect possible typos' '\n-\ttest_must_fail test-parse-options -boolean >output 2>output.err &&\n+\ttest_must_fail test-tool parse-options -boolean >output 2>output.err &&\n \ttest_must_be_empty output &&\n \ttest_cmp typo.err output.err\n '\n@@ -236,13 +236,13 @@ error: did you mean `--ambiguous` (with two dashes ?)\n EOF\n \n test_expect_success 'detect possible typos' '\n-\ttest_must_fail test-parse-options -ambiguous >output 2>output.err &&\n+\ttest_must_fail test-tool parse-options -ambiguous >output 2>output.err &&\n \ttest_must_be_empty output &&\n \ttest_cmp typo.err output.err\n '\n \n test_expect_success 'keep some options as arguments' '\n-\ttest-parse-options --expect=\"arg 00: --quux\" --quux\n+\ttest-tool parse-options --expect=\"arg 00: --quux\" --quux\n '\n \n cat >expect <<\\EOF\n@@ -260,7 +260,7 @@ arg 00: foo\n EOF\n \n test_expect_success 'OPT_DATE() works' '\n-\ttest-parse-options -t \"1970-01-01 00:00:01 +0000\" \\\n+\ttest-tool parse-options -t \"1970-01-01 00:00:01 +0000\" \\\n \t\tfoo -q >output 2>output.err &&\n \ttest_must_be_empty output.err &&\n \ttest_cmp expect output\n@@ -281,13 +281,13 @@ file: (not set)\n EOF\n \n test_expect_success 'OPT_CALLBACK() and OPT_BIT() work' '\n-\ttest-parse-options --length=four -b -4 >output 2>output.err &&\n+\ttest-tool parse-options --length=four -b -4 >output 2>output.err &&\n \ttest_must_be_empty output.err &&\n \ttest_cmp expect output\n '\n \n test_expect_success 'OPT_CALLBACK() and callback errors work' '\n-\ttest_must_fail test-parse-options --no-length >output 2>output.err &&\n+\ttest_must_fail test-tool parse-options --no-length >output 2>output.err &&\n \ttest_must_be_empty output &&\n \ttest_must_be_empty output.err\n '\n@@ -306,31 +306,31 @@ file: (not set)\n EOF\n \n test_expect_success 'OPT_BIT() and OPT_SET_INT() work' '\n-\ttest-parse-options --set23 -bbbbb --no-or4 >output 2>output.err &&\n+\ttest-tool parse-options --set23 -bbbbb --no-or4 >output 2>output.err &&\n \ttest_must_be_empty output.err &&\n \ttest_cmp expect output\n '\n \n test_expect_success 'OPT_NEGBIT() and OPT_SET_INT() work' '\n-\ttest-parse-options --set23 -bbbbb --neg-or4 >output 2>output.err &&\n+\ttest-tool parse-options --set23 -bbbbb --neg-or4 >output 2>output.err &&\n \ttest_must_be_empty output.err &&\n \ttest_cmp expect output\n '\n \n test_expect_success 'OPT_BIT() works' '\n-\ttest-parse-options --expect=\"boolean: 6\" -bb --or4\n+\ttest-tool parse-options --expect=\"boolean: 6\" -bb --or4\n '\n \n test_expect_success 'OPT_NEGBIT() works' '\n-\ttest-parse-options --expect=\"boolean: 6\" -bb --no-neg-or4\n+\ttest-tool parse-options --expect=\"boolean: 6\" -bb --no-neg-or4\n '\n \n test_expect_success 'OPT_COUNTUP() with PARSE_OPT_NODASH works' '\n-\ttest-parse-options --expect=\"boolean: 6\" + + + + + +\n+\ttest-tool parse-options --expect=\"boolean: 6\" + + + + + +\n '\n \n test_expect_success 'OPT_NUMBER_CALLBACK() works' '\n-\ttest-parse-options --expect=\"integer: 12345\" -12345\n+\ttest-tool parse-options --expect=\"integer: 12345\" -12345\n '\n \n cat >expect <<\\EOF\n@@ -347,7 +347,7 @@ file: (not set)\n EOF\n \n test_expect_success 'negation of OPT_NONEG flags is not ambiguous' '\n-\ttest-parse-options --no-ambig >output 2>output.err &&\n+\ttest-tool parse-options --no-ambig >output 2>output.err &&\n \ttest_must_be_empty output.err &&\n \ttest_cmp expect output\n '\n@@ -358,38 +358,38 @@ list: bar\n list: baz\n EOF\n test_expect_success '--list keeps list of strings' '\n-\ttest-parse-options --list foo --list=bar --list=baz >output &&\n+\ttest-tool parse-options --list foo --list=bar --list=baz >output &&\n \ttest_cmp expect output\n '\n \n test_expect_success '--no-list resets list' '\n-\ttest-parse-options --list=other --list=irrelevant --list=options \\\n+\ttest-tool parse-options --list=other --list=irrelevant --list=options \\\n \t\t--no-list --list=foo --list=bar --list=baz >output &&\n \ttest_cmp expect output\n '\n \n test_expect_success 'multiple quiet levels' '\n-\ttest-parse-options --expect=\"quiet: 3\" -q -q -q\n+\ttest-tool parse-options --expect=\"quiet: 3\" -q -q -q\n '\n \n test_expect_success 'multiple verbose levels' '\n-\ttest-parse-options --expect=\"verbose: 3\" -v -v -v\n+\ttest-tool parse-options --expect=\"verbose: 3\" -v -v -v\n '\n \n test_expect_success '--no-quiet sets --quiet to 0' '\n-\ttest-parse-options --expect=\"quiet: 0\" --no-quiet\n+\ttest-tool parse-options --expect=\"quiet: 0\" --no-quiet\n '\n \n test_expect_success '--no-quiet resets multiple -q to 0' '\n-\ttest-parse-options --expect=\"quiet: 0\" -q -q -q --no-quiet\n+\ttest-tool parse-options --expect=\"quiet: 0\" -q -q -q --no-quiet\n '\n \n test_expect_success '--no-verbose sets verbose to 0' '\n-\ttest-parse-options --expect=\"verbose: 0\" --no-verbose\n+\ttest-tool parse-options --expect=\"verbose: 0\" --no-verbose\n '\n \n test_expect_success '--no-verbose resets multiple verbose to 0' '\n-\ttest-parse-options --expect=\"verbose: 0\" -v -v -v --no-verbose\n+\ttest-tool parse-options --expect=\"verbose: 0\" -v -v -v --no-verbose\n '\n \n test_done\n-- \n2.19.0.rc0.337.ge906d732e7\n\n"},{"id":"357769","messageId":"20180909173631.1446-6-pclouds@gmail.com","threadId":"49307","inReplyTo":"20180909173631.1446-1-pclouds@gmail.com","subject":"[PATCH 5/6] t/helper: merge test-dump-fsmonitor into test-tool","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-09-09T17:36:30Z","receivedAt":"2018-09-09T17:36:48Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile                       |  2 +-\n t/helper/test-dump-fsmonitor.c |  3 ++-\n t/helper/test-tool.c           |  1 +\n t/helper/test-tool.h           |  1 +\n t/t7519-status-fsmonitor.sh    | 10 +++++-----\n 5 files changed, 10 insertions(+), 7 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 1a8a7cb82d..ea7454632d 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -709,6 +709,7 @@ TEST_BUILTINS_OBJS += test-date.o\n TEST_BUILTINS_OBJS += test-delta.o\n TEST_BUILTINS_OBJS += test-drop-caches.o\n TEST_BUILTINS_OBJS += test-dump-cache-tree.o\n+TEST_BUILTINS_OBJS += test-dump-fsmonitor.o\n TEST_BUILTINS_OBJS += test-dump-split-index.o\n TEST_BUILTINS_OBJS += test-dump-untracked-cache.o\n TEST_BUILTINS_OBJS += test-example-decorate.o\n@@ -743,7 +744,6 @@ TEST_BUILTINS_OBJS += test-urlmatch-normalization.o\n TEST_BUILTINS_OBJS += test-wildmatch.o\n TEST_BUILTINS_OBJS += test-write-cache.o\n \n-TEST_PROGRAMS_NEED_X += test-dump-fsmonitor\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-svn-fe\ndiff --git a/t/helper/test-dump-fsmonitor.c b/t/helper/test-dump-fsmonitor.c\nindex ad452707e8..08e3684aff 100644\n--- a/t/helper/test-dump-fsmonitor.c\n+++ b/t/helper/test-dump-fsmonitor.c\n@@ -1,6 +1,7 @@\n+#include \"test-tool.h\"\n #include \"cache.h\"\n \n-int cmd_main(int ac, const char **av)\n+int cmd__dump_fsmonitor(int ac, const char **av)\n {\n \tstruct index_state *istate = &the_index;\n \tint i;\ndiff --git a/t/helper/test-tool.c b/t/helper/test-tool.c\nindex 9cc21024e9..6261c2fda0 100644\n--- a/t/helper/test-tool.c\n+++ b/t/helper/test-tool.c\n@@ -14,6 +14,7 @@ static struct test_cmd cmds[] = {\n \t{ \"delta\", cmd__delta },\n \t{ \"drop-caches\", cmd__drop_caches },\n \t{ \"dump-cache-tree\", cmd__dump_cache_tree },\n+\t{ \"dump-fsmonitor\", cmd__dump_fsmonitor },\n \t{ \"dump-split-index\", cmd__dump_split_index },\n \t{ \"dump-untracked-cache\", cmd__dump_untracked_cache },\n \t{ \"example-decorate\", cmd__example_decorate },\ndiff --git a/t/helper/test-tool.h b/t/helper/test-tool.h\nindex 527722f4b0..38da025511 100644\n--- a/t/helper/test-tool.h\n+++ b/t/helper/test-tool.h\n@@ -10,6 +10,7 @@ int cmd__date(int argc, const char **argv);\n int cmd__delta(int argc, const char **argv);\n int cmd__drop_caches(int argc, const char **argv);\n int cmd__dump_cache_tree(int argc, const char **argv);\n+int cmd__dump_fsmonitor(int argc, const char **argv);\n int cmd__dump_split_index(int argc, const char **argv);\n int cmd__dump_untracked_cache(int argc, const char **argv);\n int cmd__example_decorate(int argc, const char **argv);\ndiff --git a/t/t7519-status-fsmonitor.sh b/t/t7519-status-fsmonitor.sh\nindex 603d27789b..8384ad258c 100755\n--- a/t/t7519-status-fsmonitor.sh\n+++ b/t/t7519-status-fsmonitor.sh\n@@ -84,21 +84,21 @@ test_expect_success 'setup' '\n \n # test that the fsmonitor extension is off by default\n test_expect_success 'fsmonitor extension is off by default' '\n-\ttest-dump-fsmonitor >actual &&\n+\ttest-tool dump-fsmonitor >actual &&\n \tgrep \"^no fsmonitor\" actual\n '\n \n # test that \"update-index --fsmonitor\" adds the fsmonitor extension\n test_expect_success 'update-index --fsmonitor\" adds the fsmonitor extension' '\n \tgit update-index --fsmonitor &&\n-\ttest-dump-fsmonitor >actual &&\n+\ttest-tool dump-fsmonitor >actual &&\n \tgrep \"^fsmonitor last update\" actual\n '\n \n # test that \"update-index --no-fsmonitor\" removes the fsmonitor extension\n test_expect_success 'update-index --no-fsmonitor\" removes the fsmonitor extension' '\n \tgit update-index --no-fsmonitor &&\n-\ttest-dump-fsmonitor >actual &&\n+\ttest-tool dump-fsmonitor >actual &&\n \tgrep \"^no fsmonitor\" actual\n '\n \n@@ -307,9 +307,9 @@ test_expect_success 'splitting the index results in the same state' '\n \tdirty_repo &&\n \tgit update-index --fsmonitor  &&\n \tgit ls-files -f >expect &&\n-\ttest-dump-fsmonitor >&2 && echo &&\n+\ttest-tool dump-fsmonitor >&2 && echo &&\n \tgit update-index --fsmonitor --split-index &&\n-\ttest-dump-fsmonitor >&2 && echo &&\n+\ttest-tool dump-fsmonitor >&2 && echo &&\n \tgit ls-files -f >actual &&\n \ttest_cmp expect actual\n '\n-- \n2.19.0.rc0.337.ge906d732e7\n\n"},{"id":"357770","messageId":"20180909173631.1446-7-pclouds@gmail.com","threadId":"49307","inReplyTo":"20180909173631.1446-1-pclouds@gmail.com","subject":"[PATCH 6/6] Makefile: add a hint about TEST_BUILTINS_OBJS","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2018-09-09T17:36:31Z","receivedAt":"2018-09-09T17:36:49Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Makefile | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/Makefile b/Makefile\nindex ea7454632d..39d39257e0 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -744,6 +744,8 @@ TEST_BUILTINS_OBJS += test-urlmatch-normalization.o\n TEST_BUILTINS_OBJS += test-wildmatch.o\n TEST_BUILTINS_OBJS += test-write-cache.o\n \n+# Do not add more tests here unless they have extra dependencies. Add\n+# them in TEST_BUILTINS_OBJS above.\n TEST_PROGRAMS_NEED_X += test-fake-ssh\n TEST_PROGRAMS_NEED_X += test-line-buffer\n TEST_PROGRAMS_NEED_X += test-svn-fe\n-- \n2.19.0.rc0.337.ge906d732e7\n\n"},{"id":"357771","messageId":"87o9d6lezg.fsf@evledraar.gmail.com","threadId":"49307","inReplyTo":"20180909173631.1446-1-pclouds@gmail.com","subject":"Re: [PATCH 0/6] Merge remaining t/helper binaries to test-tool","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2018-09-09T18:09:39Z","receivedAt":"2018-09-09T18:09:43Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Sun, Sep 09 2018, Nguyễn Thái Ngọc Duy wrote:\n\n> Last time when I added test-tool in 27f25845cf (Merge branch\n> 'nd/combined-test-helper' - 2018-04-11) I left out a few test programs\n> because there were a couple in-flight new tests that used them. All\n> those topics are merged now. So we can merge these to test-tool and\n> call it done.\n\nThis is great. Just a small side-note: Am I the only one who misses the\n2.8.0 days when you could do \"git clean -dxff\" in the t/ directory to\nclean up various test crap without breaking subsequent tests?\n\nThat went away in e6e7530d10 (\"test helpers: move test-* to t/helper/\nsubdirectory\", 2016-04-13) when we started building stuff in t/helper/.\n\nSo now that this is one binary perhaps we can build it in the root\ndirectory and get that functionality back?\n"},{"id":"357772","messageId":"CACsJy8BJYKBcPZeTwP4_0bUsDM4uRxafS77T6RnG9U6h_t2y5g@mail.gmail.com","threadId":"49307","inReplyTo":"87o9d6lezg.fsf@evledraar.gmail.com","subject":"Re: [PATCH 0/6] Merge remaining t/helper binaries to test-tool","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2018-09-09T18:24:36Z","receivedAt":"2018-09-09T18:25:04Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sun, Sep 9, 2018 at 8:09 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n>\n>\n> On Sun, Sep 09 2018, Nguyễn Thái Ngọc Duy wrote:\n>\n> > Last time when I added test-tool in 27f25845cf (Merge branch\n> > 'nd/combined-test-helper' - 2018-04-11) I left out a few test programs\n> > because there were a couple in-flight new tests that used them. All\n> > those topics are merged now. So we can merge these to test-tool and\n> > call it done.\n>\n> This is great. Just a small side-note: Am I the only one who misses the\n> 2.8.0 days when you could do \"git clean -dxff\" in the t/ directory to\n> clean up various test crap without breaking subsequent tests?\n\nIsn't \"make clean\" (in t/) enough?\n\n> That went away in e6e7530d10 (\"test helpers: move test-* to t/helper/\n> subdirectory\", 2016-04-13) when we started building stuff in t/helper/.\n>\n> So now that this is one binary perhaps we can build it in the root\n> directory and get that functionality back?\n\nIt's still a few binaries. Most of them are now merged to test-tool,\nbut ones that need separate program name, or have extra deps, stay\nseparate. Having said that, producing the binaries at root directory\nis possible. I'm just not sure if it's worth doing.\n-- \nDuy\n"},{"id":"357774","messageId":"20180909222438.GR432229@genre.crustytoothpaste.net","threadId":"49307","inReplyTo":"20180909173631.1446-2-pclouds@gmail.com","subject":"Re: [PATCH 1/6] t/helper: keep test-tool command list sorted","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2018-09-09T22:24:38Z","receivedAt":"2018-09-10T03:11:54Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On Sun, Sep 09, 2018 at 07:36:26PM +0200, Nguyễn Thái Ngọc Duy wrote:\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  Makefile             | 2 +-\n>  t/helper/test-tool.c | 2 +-\n>  t/helper/test-tool.h | 2 +-\n>  3 files changed, 3 insertions(+), 3 deletions(-)\n> \n> diff --git a/Makefile b/Makefile\n> index 5a969f5830..1208584fa1 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -729,8 +729,8 @@ TEST_BUILTINS_OBJS += test-repository.o\n>  TEST_BUILTINS_OBJS += test-revision-walking.o\n>  TEST_BUILTINS_OBJS += test-run-command.o\n>  TEST_BUILTINS_OBJS += test-scrap-cache-tree.o\n> -TEST_BUILTINS_OBJS += test-sha1-array.o\n>  TEST_BUILTINS_OBJS += test-sha1.o\n> +TEST_BUILTINS_OBJS += test-sha1-array.o\n>  TEST_BUILTINS_OBJS += test-sigchain.o\n>  TEST_BUILTINS_OBJS += test-strcmp-offset.o\n>  TEST_BUILTINS_OBJS += test-string-list.o\n\nThanks for fixing this.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"}]}