t/helper: merge test-prio-queue 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 15b75817765be6d641590c69b6d42324147b293d
5 files changed +8 -5
Makefile
+1 -1
@@ -670,6 +670,7 @@ TEST_BUILTINS_OBJS += test-mergesort.o
670 TEST_BUILTINS_OBJS += test-mktemp.o
671 TEST_BUILTINS_OBJS += test-online-cpus.o
672 TEST_BUILTINS_OBJS += test-path-utils.o
673 +TEST_BUILTINS_OBJS += test-prio-queue.o
674 TEST_BUILTINS_OBJS += test-sha1.o
675
676 TEST_PROGRAMS_NEED_X += test-dump-fsmonitor
@@ -677,7 +678,6 @@ TEST_PROGRAMS_NEED_X += test-dump-untracked-cache
678 TEST_PROGRAMS_NEED_X += test-fake-ssh
679 TEST_PROGRAMS_NEED_X += test-line-buffer
680 TEST_PROGRAMS_NEED_X += test-parse-options
680 -TEST_PROGRAMS_NEED_X += test-prio-queue
681 TEST_PROGRAMS_NEED_X += test-read-cache
682 TEST_PROGRAMS_NEED_X += test-write-cache
683 TEST_PROGRAMS_NEED_X += test-ref-store
t/helper/test-prio-queue.c
+2 -1
@@ -1,3 +1,4 @@
1 +#include "test-tool.h"
2 #include "cache.h"
3 #include "prio-queue.h"
4
@@ -16,7 +17,7 @@ static void show(int *v)
17 free(v);
18 }
19
19 -int cmd_main(int argc, const char **argv)
20 +int cmd__prio_queue(int argc, const char **argv)
21 {
22 struct prio_queue pq = { intcmp };
23
t/helper/test-tool.c
+1
@@ -25,6 +25,7 @@ static struct test_cmd cmds[] = {
25 { "mktemp", cmd__mktemp },
26 { "online-cpus", cmd__online_cpus },
27 { "path-utils", cmd__path_utils },
28 + { "prio-queue", cmd__prio_queue },
29 { "sha1", cmd__sha1 },
30 };
31
t/helper/test-tool.h
+1
@@ -19,6 +19,7 @@ int cmd__mergesort(int argc, const char **argv);
19 int cmd__mktemp(int argc, const char **argv);
20 int cmd__online_cpus(int argc, const char **argv);
21 int cmd__path_utils(int argc, const char **argv);
22 +int cmd__prio_queue(int argc, const char **argv);
23 int cmd__sha1(int argc, const char **argv);
24
25 #endif
t/t0009-prio-queue.sh
+3 -3
@@ -17,7 +17,7 @@ cat >expect <<'EOF'
17 10
18 EOF
19 test_expect_success 'basic ordering' '
20 - test-prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&
20 + test-tool prio-queue 2 6 3 10 9 5 7 4 5 8 1 dump >actual &&
21 test_cmp expect actual
22 '
23
@@ -30,7 +30,7 @@ cat >expect <<'EOF'
30 6
31 EOF
32 test_expect_success 'mixed put and get' '
33 - test-prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&
33 + test-tool prio-queue 6 2 4 get 5 3 get get 1 dump >actual &&
34 test_cmp expect actual
35 '
36
@@ -43,7 +43,7 @@ NULL
43 NULL
44 EOF
45 test_expect_success 'notice empty queue' '
46 - test-prio-queue 1 2 get get get 1 2 get get get >actual &&
46 + test-tool prio-queue 1 2 get get get 1 2 get get get >actual &&
47 test_cmp expect actual
48 '
49