t/helper: merge test-lazy-init-name-hash 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
64eb82fea8fbfe96e02997921283f6ffa368f5fe
6 files changed
+15
-12
Makefile
+1
-1
@@ -653,6 +653,7 @@ X =
653
PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
654
655
TEST_BUILTINS_OBJS += test-chmtime.o
656
+TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o
657
TEST_BUILTINS_OBJS += test-sha1.o
658
659
TEST_PROGRAMS_NEED_X += test-ctype
@@ -669,7 +670,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh
670
TEST_PROGRAMS_NEED_X += test-genrandom
671
TEST_PROGRAMS_NEED_X += test-hashmap
672
TEST_PROGRAMS_NEED_X += test-index-version
672
-TEST_PROGRAMS_NEED_X += test-lazy-init-name-hash
673
TEST_PROGRAMS_NEED_X += test-line-buffer
674
TEST_PROGRAMS_NEED_X += test-match-trees
675
TEST_PROGRAMS_NEED_X += test-mergesort
t/helper/test-lazy-init-name-hash.c
+7
-6
@@ -1,3 +1,4 @@
1
+#include "test-tool.h"
2
#include "cache.h"
3
#include "parse-options.h"
4
@@ -184,14 +185,14 @@ static void analyze_run(void)
185
}
186
}
187
187
-int cmd_main(int argc, const char **argv)
188
+int cmd__lazy_init_name_hash(int argc, const char **argv)
189
{
190
const char *usage[] = {
190
- "test-lazy-init-name-hash -d (-s | -m)",
191
- "test-lazy-init-name-hash -p [-c c]",
192
- "test-lazy-init-name-hash -a a [--step s] [-c c]",
193
- "test-lazy-init-name-hash (-s | -m) [-c c]",
194
- "test-lazy-init-name-hash -s -m [-c c]",
191
+ "test-tool lazy-init-name-hash -d (-s | -m)",
192
+ "test-tool lazy-init-name-hash -p [-c c]",
193
+ "test-tool lazy-init-name-hash -a a [--step s] [-c c]",
194
+ "test-tool lazy-init-name-hash (-s | -m) [-c c]",
195
+ "test-tool lazy-init-name-hash -s -m [-c c]",
196
NULL
197
};
198
struct option options[] = {
t/helper/test-tool.c
+1
@@ -8,6 +8,7 @@ struct test_cmd {
8
9
static struct test_cmd cmds[] = {
10
{ "chmtime", cmd__chmtime },
11
+ { "lazy-init-name-hash", cmd__lazy_init_name_hash },
12
{ "sha1", cmd__sha1 },
13
};
14
t/helper/test-tool.h
+1
@@ -2,6 +2,7 @@
2
#define __TEST_TOOL_H__
3
4
int cmd__chmtime(int argc, const char **argv);
5
+int cmd__lazy_init_name_hash(int argc, const char **argv);
6
int cmd__sha1(int argc, const char **argv);
7
8
#endif
t/perf/p0004-lazy-init-name-hash.sh
+4
-4
@@ -7,8 +7,8 @@ test_perf_large_repo
7
test_checkout_worktree
8
9
test_expect_success 'verify both methods build the same hashmaps' '
10
- test-lazy-init-name-hash --dump --single >out.single &&
11
- if test-lazy-init-name-hash --dump --multi >out.multi
10
+ test-tool lazy-init-name-hash --dump --single >out.single &&
11
+ if test-tool lazy-init-name-hash --dump --multi >out.multi
12
then
13
test_set_prereq REPO_BIG_ENOUGH_FOR_MULTI &&
14
sort <out.single >sorted.single &&
@@ -46,11 +46,11 @@ test_expect_success 'calibrate' '
46
'
47
48
test_perf "single-threaded, $desc" "
49
- test-lazy-init-name-hash --single --count=$count
49
+ test-tool lazy-init-name-hash --single --count=$count
50
"
51
52
test_perf REPO_BIG_ENOUGH_FOR_MULTI "multi-threaded, $desc" "
53
- test-lazy-init-name-hash --multi --count=$count
53
+ test-tool lazy-init-name-hash --multi --count=$count
54
"
55
56
test_done
t/t3008-ls-files-lazy-init-name-hash.sh
+1
-1
@@ -21,7 +21,7 @@ test_expect_success 'no buffer overflow in lazy_init_name_hash' '
21
) |
22
sed "s/^/100644 $EMPTY_BLOB /" |
23
git update-index --index-info &&
24
- test-lazy-init-name-hash -m
24
+ test-tool lazy-init-name-hash -m
25
'
26
27
test_done