Skip to content

Commit d706005

Browse files
committed
Merge branch 'cp/unit-test-reftable-stack' into ps/reftable-exclude
* cp/unit-test-reftable-stack: t-reftable-stack: add test for stack iterators t-reftable-stack: add test for non-default compaction factor t-reftable-stack: use reftable_ref_record_equal() to compare ref records t-reftable-stack: use Git's tempfile API instead of mkstemp() t: harmonize t-reftable-stack.c with coding guidelines t: move reftable/stack_test.c to the unit testing framework
2 parents 4c42d5f + 2b14ced commit d706005

File tree

9 files changed

+392
-415
lines changed

9 files changed

+392
-415
lines changed

Makefile

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,6 @@ TEST_SHELL_PATH = $(SHELL_PATH)
912912
LIB_FILE = libgit.a
913913
XDIFF_LIB = xdiff/lib.a
914914
REFTABLE_LIB = reftable/libreftable.a
915-
REFTABLE_TEST_LIB = reftable/libreftable_test.a
916915

917916
GENERATED_H += command-list.h
918917
GENERATED_H += config-list.h
@@ -1349,6 +1348,7 @@ UNIT_TEST_PROGRAMS += t-reftable-merged
13491348
UNIT_TEST_PROGRAMS += t-reftable-pq
13501349
UNIT_TEST_PROGRAMS += t-reftable-readwrite
13511350
UNIT_TEST_PROGRAMS += t-reftable-record
1351+
UNIT_TEST_PROGRAMS += t-reftable-stack
13521352
UNIT_TEST_PROGRAMS += t-reftable-tree
13531353
UNIT_TEST_PROGRAMS += t-strbuf
13541354
UNIT_TEST_PROGRAMS += t-strcmp-offset
@@ -2691,9 +2691,6 @@ REFTABLE_OBJS += reftable/stack.o
26912691
REFTABLE_OBJS += reftable/tree.o
26922692
REFTABLE_OBJS += reftable/writer.o
26932693

2694-
REFTABLE_TEST_OBJS += reftable/stack_test.o
2695-
REFTABLE_TEST_OBJS += reftable/test_framework.o
2696-
26972694
TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))
26982695

26992696
.PHONY: test-objs
@@ -2868,9 +2865,6 @@ $(XDIFF_LIB): $(XDIFF_OBJS)
28682865
$(REFTABLE_LIB): $(REFTABLE_OBJS)
28692866
$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
28702867

2871-
$(REFTABLE_TEST_LIB): $(REFTABLE_TEST_OBJS)
2872-
$(QUIET_AR)$(RM) $@ && $(AR) $(ARFLAGS) $@ $^
2873-
28742868
export DEFAULT_EDITOR DEFAULT_PAGER
28752869

28762870
Documentation/GIT-EXCLUDED-PROGRAMS: FORCE
@@ -3250,7 +3244,7 @@ perf: all
32503244

32513245
t/helper/test-tool$X: $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS)) $(UNIT_TEST_DIR)/test-lib.o
32523246

3253-
t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS) $(REFTABLE_TEST_LIB)
3247+
t/helper/test-%$X: t/helper/test-%.o GIT-LDFLAGS $(GITLIBS)
32543248
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(filter %.a,$^) $(LIBS)
32553249

32563250
check-sha1:: t/helper/test-tool$X
@@ -3711,7 +3705,7 @@ clean: profile-clean coverage-clean cocciclean
37113705
$(RM) git.res
37123706
$(RM) $(OBJECTS)
37133707
$(RM) headless-git.o
3714-
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB)
3708+
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB)
37153709
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)
37163710
$(RM) $(TEST_PROGRAMS)
37173711
$(RM) $(FUZZ_PROGRAMS)

reftable/reftable-tests.h

Lines changed: 0 additions & 14 deletions
This file was deleted.

reftable/test_framework.c

Lines changed: 0 additions & 27 deletions
This file was deleted.

reftable/test_framework.h

Lines changed: 0 additions & 61 deletions
This file was deleted.

t/helper/test-reftable.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,8 @@
66
#include "reftable/reftable-merged.h"
77
#include "reftable/reftable-reader.h"
88
#include "reftable/reftable-stack.h"
9-
#include "reftable/reftable-tests.h"
109
#include "test-tool.h"
1110

12-
int cmd__reftable(int argc, const char **argv)
13-
{
14-
/* test from simple to complex. */
15-
stack_test_main(argc, argv);
16-
return 0;
17-
}
18-
1911
static void print_help(void)
2012
{
2113
printf("usage: dump [-st] arg\n\n"

t/helper/test-tool.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ static struct test_cmd cmds[] = {
2626
{ "drop-caches", cmd__drop_caches },
2727
{ "dump-cache-tree", cmd__dump_cache_tree },
2828
{ "dump-fsmonitor", cmd__dump_fsmonitor },
29+
{ "dump-reftable", cmd__dump_reftable },
2930
{ "dump-split-index", cmd__dump_split_index },
3031
{ "dump-untracked-cache", cmd__dump_untracked_cache },
3132
{ "env-helper", cmd__env_helper },
@@ -61,9 +62,7 @@ static struct test_cmd cmds[] = {
6162
{ "read-graph", cmd__read_graph },
6263
{ "read-midx", cmd__read_midx },
6364
{ "ref-store", cmd__ref_store },
64-
{ "reftable", cmd__reftable },
6565
{ "rot13-filter", cmd__rot13_filter },
66-
{ "dump-reftable", cmd__dump_reftable },
6766
{ "regex", cmd__regex },
6867
{ "repository", cmd__repository },
6968
{ "revision-walking", cmd__revision_walking },

t/helper/test-tool.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ int cmd__read_graph(int argc, const char **argv);
5555
int cmd__read_midx(int argc, const char **argv);
5656
int cmd__ref_store(int argc, const char **argv);
5757
int cmd__rot13_filter(int argc, const char **argv);
58-
int cmd__reftable(int argc, const char **argv);
5958
int cmd__regex(int argc, const char **argv);
6059
int cmd__repository(int argc, const char **argv);
6160
int cmd__revision_walking(int argc, const char **argv);

t/t0032-reftable-unittest.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)