t/helper: merge test-dump-fsmonitor into test-tool
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy committed
Sep 9, 2018 at 19:36 UTC
f1ef0b024cb22d139e172daedb88852425ad5ad4
5 files changed
+10
-7
Makefile
+1
-1
@@ -709,6 +709,7 @@ TEST_BUILTINS_OBJS += test-date.o
709
TEST_BUILTINS_OBJS += test-delta.o
710
TEST_BUILTINS_OBJS += test-drop-caches.o
711
TEST_BUILTINS_OBJS += test-dump-cache-tree.o
712
+TEST_BUILTINS_OBJS += test-dump-fsmonitor.o
713
TEST_BUILTINS_OBJS += test-dump-split-index.o
714
TEST_BUILTINS_OBJS += test-dump-untracked-cache.o
715
TEST_BUILTINS_OBJS += test-example-decorate.o
@@ -743,7 +744,6 @@ TEST_BUILTINS_OBJS += test-urlmatch-normalization.o
744
TEST_BUILTINS_OBJS += test-wildmatch.o
745
TEST_BUILTINS_OBJS += test-write-cache.o
746
746
-TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
747
TEST_PROGRAMS_NEED_X += test-fake-ssh
748
TEST_PROGRAMS_NEED_X += test-line-buffer
749
TEST_PROGRAMS_NEED_X += test-svn-fe
t/helper/test-dump-fsmonitor.c
+2
-1
@@ -1,6 +1,7 @@
1
+#include "test-tool.h"
2
#include "cache.h"
3
3
-int cmd_main(int ac, const char **av)
4
+int cmd__dump_fsmonitor(int ac, const char **av)
5
{
6
struct index_state *istate = &the_index;
7
int i;
t/helper/test-tool.c
+1
@@ -14,6 +14,7 @@ static struct test_cmd cmds[] = {
14
{ "delta", cmd__delta },
15
{ "drop-caches", cmd__drop_caches },
16
{ "dump-cache-tree", cmd__dump_cache_tree },
17
+ { "dump-fsmonitor", cmd__dump_fsmonitor },
18
{ "dump-split-index", cmd__dump_split_index },
19
{ "dump-untracked-cache", cmd__dump_untracked_cache },
20
{ "example-decorate", cmd__example_decorate },
t/helper/test-tool.h
+1
@@ -10,6 +10,7 @@ int cmd__date(int argc, const char **argv);
10
int cmd__delta(int argc, const char **argv);
11
int cmd__drop_caches(int argc, const char **argv);
12
int cmd__dump_cache_tree(int argc, const char **argv);
13
+int cmd__dump_fsmonitor(int argc, const char **argv);
14
int cmd__dump_split_index(int argc, const char **argv);
15
int cmd__dump_untracked_cache(int argc, const char **argv);
16
int cmd__example_decorate(int argc, const char **argv);
t/t7519-status-fsmonitor.sh
+5
-5
@@ -84,21 +84,21 @@ test_expect_success 'setup' '
84
85
# test that the fsmonitor extension is off by default
86
test_expect_success 'fsmonitor extension is off by default' '
87
- test-dump-fsmonitor >actual &&
87
+ test-tool dump-fsmonitor >actual &&
88
grep "^no fsmonitor" actual
89
'
90
91
# test that "update-index --fsmonitor" adds the fsmonitor extension
92
test_expect_success 'update-index --fsmonitor" adds the fsmonitor extension' '
93
git update-index --fsmonitor &&
94
- test-dump-fsmonitor >actual &&
94
+ test-tool dump-fsmonitor >actual &&
95
grep "^fsmonitor last update" actual
96
'
97
98
# test that "update-index --no-fsmonitor" removes the fsmonitor extension
99
test_expect_success 'update-index --no-fsmonitor" removes the fsmonitor extension' '
100
git update-index --no-fsmonitor &&
101
- test-dump-fsmonitor >actual &&
101
+ test-tool dump-fsmonitor >actual &&
102
grep "^no fsmonitor" actual
103
'
104
@@ -307,9 +307,9 @@ test_expect_success 'splitting the index results in the same state' '
307
dirty_repo &&
308
git update-index --fsmonitor &&
309
git ls-files -f >expect &&
310
- test-dump-fsmonitor >&2 && echo &&
310
+ test-tool dump-fsmonitor >&2 && echo &&
311
git update-index --fsmonitor --split-index &&
312
- test-dump-fsmonitor >&2 && echo &&
312
+ test-tool dump-fsmonitor >&2 && echo &&
313
git ls-files -f >actual &&
314
test_cmp expect actual
315
'