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>maint
parent
dae2ff9bb6
commit
64eb82fea8
2
Makefile
2
Makefile
|
@ -653,6 +653,7 @@ X =
|
||||||
PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
|
PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
|
||||||
|
|
||||||
TEST_BUILTINS_OBJS += test-chmtime.o
|
TEST_BUILTINS_OBJS += test-chmtime.o
|
||||||
|
TEST_BUILTINS_OBJS += test-lazy-init-name-hash.o
|
||||||
TEST_BUILTINS_OBJS += test-sha1.o
|
TEST_BUILTINS_OBJS += test-sha1.o
|
||||||
|
|
||||||
TEST_PROGRAMS_NEED_X += test-ctype
|
TEST_PROGRAMS_NEED_X += test-ctype
|
||||||
|
@ -669,7 +670,6 @@ TEST_PROGRAMS_NEED_X += test-fake-ssh
|
||||||
TEST_PROGRAMS_NEED_X += test-genrandom
|
TEST_PROGRAMS_NEED_X += test-genrandom
|
||||||
TEST_PROGRAMS_NEED_X += test-hashmap
|
TEST_PROGRAMS_NEED_X += test-hashmap
|
||||||
TEST_PROGRAMS_NEED_X += test-index-version
|
TEST_PROGRAMS_NEED_X += test-index-version
|
||||||
TEST_PROGRAMS_NEED_X += test-lazy-init-name-hash
|
|
||||||
TEST_PROGRAMS_NEED_X += test-line-buffer
|
TEST_PROGRAMS_NEED_X += test-line-buffer
|
||||||
TEST_PROGRAMS_NEED_X += test-match-trees
|
TEST_PROGRAMS_NEED_X += test-match-trees
|
||||||
TEST_PROGRAMS_NEED_X += test-mergesort
|
TEST_PROGRAMS_NEED_X += test-mergesort
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include "test-tool.h"
|
||||||
#include "cache.h"
|
#include "cache.h"
|
||||||
#include "parse-options.h"
|
#include "parse-options.h"
|
||||||
|
|
||||||
|
@ -184,14 +185,14 @@ static void analyze_run(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int cmd_main(int argc, const char **argv)
|
int cmd__lazy_init_name_hash(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
const char *usage[] = {
|
const char *usage[] = {
|
||||||
"test-lazy-init-name-hash -d (-s | -m)",
|
"test-tool lazy-init-name-hash -d (-s | -m)",
|
||||||
"test-lazy-init-name-hash -p [-c c]",
|
"test-tool lazy-init-name-hash -p [-c c]",
|
||||||
"test-lazy-init-name-hash -a a [--step s] [-c c]",
|
"test-tool lazy-init-name-hash -a a [--step s] [-c c]",
|
||||||
"test-lazy-init-name-hash (-s | -m) [-c c]",
|
"test-tool lazy-init-name-hash (-s | -m) [-c c]",
|
||||||
"test-lazy-init-name-hash -s -m [-c c]",
|
"test-tool lazy-init-name-hash -s -m [-c c]",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
struct option options[] = {
|
struct option options[] = {
|
||||||
|
|
|
@ -8,6 +8,7 @@ struct test_cmd {
|
||||||
|
|
||||||
static struct test_cmd cmds[] = {
|
static struct test_cmd cmds[] = {
|
||||||
{ "chmtime", cmd__chmtime },
|
{ "chmtime", cmd__chmtime },
|
||||||
|
{ "lazy-init-name-hash", cmd__lazy_init_name_hash },
|
||||||
{ "sha1", cmd__sha1 },
|
{ "sha1", cmd__sha1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
#define __TEST_TOOL_H__
|
#define __TEST_TOOL_H__
|
||||||
|
|
||||||
int cmd__chmtime(int argc, const char **argv);
|
int cmd__chmtime(int argc, const char **argv);
|
||||||
|
int cmd__lazy_init_name_hash(int argc, const char **argv);
|
||||||
int cmd__sha1(int argc, const char **argv);
|
int cmd__sha1(int argc, const char **argv);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -7,8 +7,8 @@ test_perf_large_repo
|
||||||
test_checkout_worktree
|
test_checkout_worktree
|
||||||
|
|
||||||
test_expect_success 'verify both methods build the same hashmaps' '
|
test_expect_success 'verify both methods build the same hashmaps' '
|
||||||
test-lazy-init-name-hash --dump --single >out.single &&
|
test-tool lazy-init-name-hash --dump --single >out.single &&
|
||||||
if test-lazy-init-name-hash --dump --multi >out.multi
|
if test-tool lazy-init-name-hash --dump --multi >out.multi
|
||||||
then
|
then
|
||||||
test_set_prereq REPO_BIG_ENOUGH_FOR_MULTI &&
|
test_set_prereq REPO_BIG_ENOUGH_FOR_MULTI &&
|
||||||
sort <out.single >sorted.single &&
|
sort <out.single >sorted.single &&
|
||||||
|
@ -46,11 +46,11 @@ test_expect_success 'calibrate' '
|
||||||
'
|
'
|
||||||
|
|
||||||
test_perf "single-threaded, $desc" "
|
test_perf "single-threaded, $desc" "
|
||||||
test-lazy-init-name-hash --single --count=$count
|
test-tool lazy-init-name-hash --single --count=$count
|
||||||
"
|
"
|
||||||
|
|
||||||
test_perf REPO_BIG_ENOUGH_FOR_MULTI "multi-threaded, $desc" "
|
test_perf REPO_BIG_ENOUGH_FOR_MULTI "multi-threaded, $desc" "
|
||||||
test-lazy-init-name-hash --multi --count=$count
|
test-tool lazy-init-name-hash --multi --count=$count
|
||||||
"
|
"
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
|
@ -21,7 +21,7 @@ test_expect_success 'no buffer overflow in lazy_init_name_hash' '
|
||||||
) |
|
) |
|
||||||
sed "s/^/100644 $EMPTY_BLOB /" |
|
sed "s/^/100644 $EMPTY_BLOB /" |
|
||||||
git update-index --index-info &&
|
git update-index --index-info &&
|
||||||
test-lazy-init-name-hash -m
|
test-tool lazy-init-name-hash -m
|
||||||
'
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Loading…
Reference in New Issue