t/helper: merge test-scrap-cache-tree 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
Mar 24, 2018 at 08:44 UTC
ff5fb8b0343270caeb8f4b650c515d7755f57903
5 files changed
+9
-6
Makefile
+1
-1
@@ -676,6 +676,7 @@ TEST_BUILTINS_OBJS += test-ref-store.o
676
TEST_BUILTINS_OBJS += test-regex.o
677
TEST_BUILTINS_OBJS += test-revision-walking.o
678
TEST_BUILTINS_OBJS += test-run-command.o
679
+TEST_BUILTINS_OBJS += test-scrap-cache-tree.o
680
TEST_BUILTINS_OBJS += test-sha1.o
681
682
TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
@@ -684,7 +685,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh
685
TEST_PROGRAMS_NEED_X += test-line-buffer
686
TEST_PROGRAMS_NEED_X += test-parse-options
687
TEST_PROGRAMS_NEED_X += test-write-cache
687
-TEST_PROGRAMS_NEED_X += test-scrap-cache-tree
688
TEST_PROGRAMS_NEED_X += test-sha1-array
689
TEST_PROGRAMS_NEED_X += test-sigchain
690
TEST_PROGRAMS_NEED_X += test-strcmp-offset
t/helper/test-scrap-cache-tree.c
+2
-1
@@ -1,3 +1,4 @@
1
+#include "test-tool.h"
2
#include "cache.h"
3
#include "lockfile.h"
4
#include "tree.h"
@@ -5,7 +6,7 @@
6
7
static struct lock_file index_lock;
8
8
-int cmd_main(int ac, const char **av)
9
+int cmd__scrap_cache_tree(int ac, const char **av)
10
{
11
setup_git_directory();
12
hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
t/helper/test-tool.c
+1
@@ -31,6 +31,7 @@ static struct test_cmd cmds[] = {
31
{ "regex", cmd__regex },
32
{ "revision-walking", cmd__revision_walking },
33
{ "run-command", cmd__run_command },
34
+ { "scrap-cache-tree", cmd__scrap_cache_tree },
35
{ "sha1", cmd__sha1 },
36
};
37
t/helper/test-tool.h
+1
@@ -25,6 +25,7 @@ int cmd__ref_store(int argc, const char **argv);
25
int cmd__regex(int argc, const char **argv);
26
int cmd__revision_walking(int argc, const char **argv);
27
int cmd__run_command(int argc, const char **argv);
28
+int cmd__scrap_cache_tree(int argc, const char **argv);
29
int cmd__sha1(int argc, const char **argv);
30
31
#endif
t/t0090-cache-tree.sh
+4
-4
@@ -115,14 +115,14 @@ test_expect_success 'update-index invalidates cache-tree' '
115
'
116
117
test_expect_success 'write-tree establishes cache-tree' '
118
- test-scrap-cache-tree &&
118
+ test-tool scrap-cache-tree &&
119
git write-tree &&
120
test_cache_tree
121
'
122
123
-test_expect_success 'test-scrap-cache-tree works' '
123
+test_expect_success 'test-tool scrap-cache-tree works' '
124
git read-tree HEAD &&
125
- test-scrap-cache-tree &&
125
+ test-tool scrap-cache-tree &&
126
test_no_cache_tree
127
'
128
@@ -170,7 +170,7 @@ test_expect_success 'commit in child dir has cache-tree' '
170
'
171
172
test_expect_success 'reset --hard gives cache-tree' '
173
- test-scrap-cache-tree &&
173
+ test-tool scrap-cache-tree &&
174
git reset --hard &&
175
test_cache_tree
176
'