2007-08-09 13:35:23 +00:00
|
|
|
# On cygwin do:
|
|
|
|
# make CYGWIN=cygwin check
|
|
|
|
|
2007-12-22 20:56:20 +00:00
|
|
|
# For verbose output do
|
|
|
|
# make VERBOSE=1
|
|
|
|
# For very verbose output do
|
|
|
|
# make VERBOSE=2
|
|
|
|
|
2007-07-13 19:37:47 +00:00
|
|
|
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage
|
2008-03-06 16:35:18 +00:00
|
|
|
# PROF_FLAGS = -pg
|
2008-03-12 19:40:38 +00:00
|
|
|
OPTFLAGS = -O2
|
2007-08-09 13:35:23 +00:00
|
|
|
|
2007-12-22 20:56:20 +00:00
|
|
|
ifeq ($(VERBOSE),2)
|
|
|
|
VERBVERBOSE=-v
|
|
|
|
MAYBEATSIGN=
|
|
|
|
else
|
|
|
|
ifeq ($(VERBOSE),1)
|
|
|
|
VERBVERBOSE=-q
|
|
|
|
MAYBEATSIGN=
|
|
|
|
else
|
|
|
|
VERBVERBOSE=-q
|
|
|
|
MAYBEATSIGN=@
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2007-08-09 13:35:23 +00:00
|
|
|
ifeq ($(CYGWIN),cygwin)
|
|
|
|
else
|
|
|
|
FPICFLAGS = -fPIC
|
|
|
|
# valgrind is not present on cygwin
|
2008-04-02 23:40:36 +00:00
|
|
|
VGRIND = valgrind --quiet --error-exitcode=1 --leak-check=yes
|
2007-08-09 13:35:23 +00:00
|
|
|
endif
|
|
|
|
|
2008-04-02 23:40:36 +00:00
|
|
|
CFLAGS = -Wall -W -Wcast-align -Wbad-function-cast -Wextra -Wmissing-noreturn -Wmissing-format-attribute $(OPTFLAGS) -g3 -ggdb3 $(GCOV_FLAGS) $(PROF_FLAGS) -Werror $(FPICFLAGS) -Wshadow -fvisibility=hidden
|
2007-08-09 13:35:23 +00:00
|
|
|
LDFLAGS = $(OPTFLAGS) -g $(GCOV_FLAGS) $(PROF_FLAGS)
|
2007-10-19 17:05:10 +00:00
|
|
|
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
|
2007-08-09 13:35:23 +00:00
|
|
|
|
2008-04-04 18:22:01 +00:00
|
|
|
leafentry.o: CFLAGS+=-Wconversion
|
|
|
|
|
2007-08-25 21:58:25 +00:00
|
|
|
ifdef BRT_FANOUT
|
|
|
|
CPPFLAGS += -DBRT_FANOUT=$(BRT_FANOUT)
|
|
|
|
endif
|
|
|
|
|
2007-08-01 02:37:21 +00:00
|
|
|
|
|
|
|
# When debugging, try: valgrind --show-reachable=yes --leak-check=full ./brt-test
|
|
|
|
|
2007-07-13 19:37:47 +00:00
|
|
|
|
2008-04-02 23:40:36 +00:00
|
|
|
build default: bins libs tdb-recover tdb_logprint
|
2007-08-24 18:38:11 +00:00
|
|
|
# Put these one-per-line so that if we insert a new one the svn diff can understand it better.
|
|
|
|
# Also keep them sorted.
|
2007-09-12 18:12:31 +00:00
|
|
|
REGRESSION_TESTS = \
|
2008-03-06 21:46:57 +00:00
|
|
|
brt-serialize-test \
|
|
|
|
brt-test \
|
2008-04-03 20:24:47 +00:00
|
|
|
brt-test-cursor \
|
|
|
|
brt-test-cursor-2 \
|
|
|
|
brt-test-named-db \
|
2008-04-02 23:40:36 +00:00
|
|
|
brt-test0 \
|
|
|
|
brt-test1 \
|
|
|
|
brt-test2 \
|
2008-03-06 21:46:57 +00:00
|
|
|
brt-test3 \
|
2008-03-06 16:35:18 +00:00
|
|
|
brt-test4 \
|
2008-04-07 01:30:25 +00:00
|
|
|
brt-test5 \
|
2008-04-03 20:24:47 +00:00
|
|
|
cachetable-test \
|
|
|
|
cachetable-test2 \
|
|
|
|
fifo-test \
|
|
|
|
list-test \
|
2008-03-11 18:51:26 +00:00
|
|
|
log-test2 \
|
2008-03-12 17:55:11 +00:00
|
|
|
log-test3 \
|
|
|
|
log-test4 \
|
|
|
|
log-test5 \
|
|
|
|
log-test6 \
|
2008-02-07 16:35:39 +00:00
|
|
|
test-assert \
|
2008-04-03 20:24:47 +00:00
|
|
|
test-brt-delete-both \
|
|
|
|
test-brt-overflow \
|
2008-02-25 22:46:48 +00:00
|
|
|
test-del-inorder \
|
2008-04-03 20:24:47 +00:00
|
|
|
test-gpma-blackbox \
|
|
|
|
test-gpma-glassbox \
|
|
|
|
test-gpma-glassbox \
|
2008-04-07 01:30:25 +00:00
|
|
|
test-gpma-leftmost-dup \
|
2008-04-03 20:24:47 +00:00
|
|
|
test-inc-split \
|
|
|
|
test-primes \
|
|
|
|
test_oexcl \
|
|
|
|
test_toku_malloc_plain_free \
|
|
|
|
ybt-test \
|
|
|
|
log-test \
|
2007-09-12 18:12:31 +00:00
|
|
|
# This line intentially kept commented so I can have a \ on the end of the previous line
|
|
|
|
|
2008-04-03 20:24:47 +00:00
|
|
|
# Add in the binaries that must be run in various ways.
|
2007-09-12 18:12:31 +00:00
|
|
|
BINS = $(REGRESSION_TESTS) \
|
|
|
|
benchmark-test \
|
2008-04-03 20:24:47 +00:00
|
|
|
test-gpma-worstinsert \
|
2008-02-06 19:28:01 +00:00
|
|
|
brtdump \
|
2007-08-24 18:38:11 +00:00
|
|
|
randbrt \
|
|
|
|
randdb4 \
|
2007-11-24 23:48:34 +00:00
|
|
|
tdb_logprint \
|
2007-09-12 18:12:31 +00:00
|
|
|
# This line intentially kept commented so I can have a \ on the end of the previous line
|
2007-08-24 18:38:11 +00:00
|
|
|
|
2008-04-04 18:03:03 +00:00
|
|
|
OFILES = \
|
|
|
|
brt-serialize.o \
|
|
|
|
brt-verify.o \
|
|
|
|
brt.o \
|
|
|
|
cachetable.o \
|
|
|
|
fifo.o gpma.o \
|
|
|
|
fingerprint.o \
|
|
|
|
key.o \
|
|
|
|
leafentry.o \
|
|
|
|
log.o \
|
|
|
|
log_code.o \
|
|
|
|
memory.o \
|
|
|
|
mempool.o \
|
|
|
|
primes.o \
|
|
|
|
recover.o \
|
|
|
|
roll.o \
|
|
|
|
toku_assert.o \
|
|
|
|
ybt.o \
|
|
|
|
# keep this line so I can ha vea \ on the previous line
|
|
|
|
|
|
|
|
TEST_OFILES = \
|
|
|
|
$(OFILES) \
|
|
|
|
brt-test-helpers.o \
|
|
|
|
# keep this line
|
|
|
|
|
|
|
|
|
2007-11-24 23:48:34 +00:00
|
|
|
tdb_logprint: LDFLAGS+=-lz
|
2008-04-03 03:12:09 +00:00
|
|
|
tdb_logprint.o: log-internal.h brttypes.h yerror.h log.h kv-pair.h log_header.h
|
2008-04-04 18:03:03 +00:00
|
|
|
tdb_logprint: $(OFILES)
|
2007-11-23 18:27:50 +00:00
|
|
|
|
2008-03-12 19:40:38 +00:00
|
|
|
tdb-recover: LDFLAGS+=-lz
|
2008-04-09 02:45:27 +00:00
|
|
|
recover.o: log_header.h log-internal.h log.h yerror.h brttypes.h kv-pair.h memory.h key.h cachetable.h
|
2008-04-04 18:03:03 +00:00
|
|
|
tdb-recover: $(OFILES)
|
2008-01-11 03:09:14 +00:00
|
|
|
|
2008-04-02 23:40:36 +00:00
|
|
|
roll.o: log_header.h log-internal.h log.h yerror.h brttypes.h kv-pair.h memory.h key.h cachetable.h gpma.h
|
2007-11-14 22:32:53 +00:00
|
|
|
|
2007-12-04 16:16:30 +00:00
|
|
|
log_code.o: log_header.h wbuf.h log-internal.h
|
2008-03-12 17:55:11 +00:00
|
|
|
log_header.h: log_code.c
|
|
|
|
@echo generated log_code.c so log_header.c was also generated
|
|
|
|
log_code.c: logformat
|
2007-11-22 07:13:08 +00:00
|
|
|
./logformat
|
|
|
|
|
2007-09-28 17:11:22 +00:00
|
|
|
libs: log.o
|
2007-07-13 19:37:47 +00:00
|
|
|
bins: $(BINS)
|
2008-04-03 20:24:47 +00:00
|
|
|
# Put the benchmarktest_256 first since it takes the longest (and we want to use parallelism in the make)
|
2007-12-22 18:40:22 +00:00
|
|
|
CHECKS = \
|
2008-04-03 20:24:47 +00:00
|
|
|
benchmarktest_256 \
|
|
|
|
test-gpma-worstinsert-a \
|
|
|
|
test-gpma-worstinsert-b \
|
|
|
|
test-gpma-worstinsert-c \
|
|
|
|
$(REGRESSION_TESTS) \
|
2008-02-07 16:35:39 +00:00
|
|
|
# This line intentially kept commented so I can have a \ on the previous line
|
|
|
|
|
2008-03-06 21:46:57 +00:00
|
|
|
# Put check_benchmarktest_256 first because it is long-running (and therefore on the critical path, so get it started)
|
2008-04-03 20:24:47 +00:00
|
|
|
check: bins $(patsubst %,check_%,$(CHECKS))
|
2007-12-22 18:40:22 +00:00
|
|
|
check_benchmarktest_256: benchmark-test
|
2008-04-02 23:40:36 +00:00
|
|
|
$(VGRIND) ./benchmark-test $(VERBVERBOSE) --valsize 256 --verify 1
|
2008-04-03 20:24:47 +00:00
|
|
|
check_test-gpma-worstinsert-a: test-gpma-worstinsert
|
|
|
|
$(VGRIND) ./test-gpma-worstinsert $(VERBVERBOSE) -a
|
|
|
|
check_test-gpma-worstinsert-b: test-gpma-worstinsert
|
|
|
|
$(VGRIND) ./test-gpma-worstinsert $(VERBVERBOSE) -b
|
|
|
|
check_test-gpma-worstinsert-c: test-gpma-worstinsert
|
|
|
|
$(VGRIND) ./test-gpma-worstinsert $(VERBVERBOSE) -c
|
2007-12-22 18:40:22 +00:00
|
|
|
|
2008-02-07 16:35:39 +00:00
|
|
|
check_test-assert: test-assert
|
|
|
|
@# no arguments, should err
|
2008-04-02 23:40:36 +00:00
|
|
|
$(VGRIND) ./test-assert > /dev/null 2>&1 ; test \($$?\)
|
2008-02-07 16:35:39 +00:00
|
|
|
@# one argument, not "ok" should err
|
|
|
|
@echo Expect an abort message:
|
2008-04-02 23:40:36 +00:00
|
|
|
($(VGRIND) ./test-assert notok) > test-assert.out 2>&1 ; test \($$?\)
|
2008-02-07 16:35:39 +00:00
|
|
|
@fgrep failed test-assert.out > /dev/null
|
|
|
|
@rm test-assert.out
|
|
|
|
@# one argument, "ok" should not error
|
2008-04-02 23:40:36 +00:00
|
|
|
$(DVGRIND) ./test-assert ok
|
2007-12-22 18:40:22 +00:00
|
|
|
check_%: %
|
2008-04-02 23:40:36 +00:00
|
|
|
$(VGRIND) ./$< $(VERBVERBOSE)
|
2007-07-13 19:37:47 +00:00
|
|
|
|
2007-08-25 21:58:25 +00:00
|
|
|
check-fanout:
|
|
|
|
let BRT_FANOUT=4; \
|
|
|
|
while [ $$BRT_FANOUT -le 16 ] ;do \
|
|
|
|
make clean; make check BRT_FANOUT=$$BRT_FANOUT; \
|
|
|
|
let BRT_FANOUT=BRT_FANOUT+1; \
|
|
|
|
done
|
|
|
|
|
2008-04-17 03:11:55 +00:00
|
|
|
log-test log-test2 log-test3 log-test4 log-test5 log-test6 benchmark-test brt-test brt-test0 brt-test1 brt-test2 brt-test3 brt-test4 brt-test5 test-brt-overflow brt-test-named-db brt-test-cursor brt-test-cursor-2 test-brt-delete-both brt-serialize-test brtdump test-inc-split test-del-inorder cachetable-test cachetable-test2: LDFLAGS+=-lz
|
2007-07-13 19:37:47 +00:00
|
|
|
# pma: PROF_FLAGS=-fprofile-arcs -ftest-coverage
|
2007-11-14 17:58:38 +00:00
|
|
|
|
2008-04-04 18:03:03 +00:00
|
|
|
BRT_INTERNAL_H_INCLUDES = brt-internal.h cachetable.h fifo.h gpma.h brt.h brt-search.h brttypes.h yerror.h ybt.h log.h ../include/db.h kv-pair.h memory.h crc.h mempool.h leafentry.h
|
2007-07-13 19:37:47 +00:00
|
|
|
key.o: brttypes.h key.h
|
2008-02-08 03:17:38 +00:00
|
|
|
list-test: list-test.o toku_assert.o
|
2008-04-04 18:03:03 +00:00
|
|
|
test-brt-delete-both: ybt.o brt.o fifo.o gpma.o memory.o leafentry.o brt-serialize.o cachetable.o ybt.o key.o primes.o toku_assert.o log.o mempool.o brt-verify.o fingerprint.o log_code.o roll.o
|
|
|
|
test-inc-split: $(TEST_OFILES)
|
|
|
|
brt-test-helpers.o: $(BRT_INTERNAL_H_INCLUDES) toku_assert.h
|
|
|
|
test-del-inorder: $(TEST_OFILES)
|
2008-04-02 23:40:36 +00:00
|
|
|
# pma-test.o: $(BRT_INTERNAL_H_INCLUDES) pma-internal.h gpma.h list.h mempool.h
|
|
|
|
# pma-test: pma.o memory.o key.o ybt.o log.o mempool.o fingerprint.o brt-serialize.o fifo.o primes.o toku_assert.o log_code.o roll.o brt.o cachetable.o brt-verify.o
|
|
|
|
pma.o: gpma.h yerror.h pma-internal.h memory.h key.h ybt.h brttypes.h log.h ../include/db.h log_header.h
|
|
|
|
test-gpma-glassbox.o: test-gpma-glassbox.c gpma.h gpma-internal.h toku_assert.h memory.h
|
|
|
|
test-gpma-glassbox: test-gpma-glassbox.o toku_assert.o memory-debug.o gpma.o
|
|
|
|
test-gpma-blackbox: test-gpma-blackbox.o toku_assert.o memory.o gpma.o
|
2008-04-03 18:53:34 +00:00
|
|
|
test-gpma-worstinsert: test-gpma-worstinsert.o toku_assert.o memory.o gpma.o
|
2008-04-07 01:30:25 +00:00
|
|
|
test-gpma-leftmost-dup: test-gpma-leftmost-dup.o toku_assert.o memory.o gpma.o
|
|
|
|
test-gpma-worstinsert.o test-gpma-blackbox.o test-gpma-leftmost-dup.o: gpma.h memory.h toku_assert.h
|
|
|
|
: gpma.h memory.h toku_assert.h
|
2008-04-02 23:40:36 +00:00
|
|
|
gpma.o: gpma.c gpma.h
|
2007-09-06 20:13:56 +00:00
|
|
|
ybt.o: ybt.h brttypes.h ../include/db.h
|
2008-02-08 03:17:38 +00:00
|
|
|
ybt-test: ybt-test.o ybt.o memory.o toku_assert.o
|
2007-09-06 20:13:56 +00:00
|
|
|
ybt-test.o: ybt.h ../include/db.h
|
2007-11-29 15:34:49 +00:00
|
|
|
cachetable.o: cachetable.h hashfun.h memory.h
|
2008-04-07 01:30:25 +00:00
|
|
|
brt-test0 brt-test1 brt-test2 brt-test3 brt-test4 brt-test5 test-brt-overflow brt-test-named-db brt-test-cursor brt-test-cursor-2 brt-test: ybt.o brt.o fifo.o gpma.o leafentry.o memory.o brt-serialize.o cachetable.o ybt.o key.o primes.o toku_assert.o log.o mempool.o brt-verify.o fingerprint.o log_code.o roll.o
|
2007-11-23 17:41:02 +00:00
|
|
|
log.o: log_header.h log-internal.h log.h wbuf.h crc.h brttypes.h $(BRT_INTERNAL_H_INCLUDES)
|
2008-02-08 03:17:38 +00:00
|
|
|
logformat: logformat.o toku_assert.o
|
2008-04-07 01:30:25 +00:00
|
|
|
brt-test0.o brt-test1.o brt-test2.o brt-test3.o brt-test4.o brt-test5.o test-brt-overflow.h brt-test-named-db.o brt-test-cursor.o brt-test-cursor-2.o brt-test.o brt.o: brt.h brt-search.h ../include/db.h fifo.h gpma.h brttypes.h cachetable.h memory.h $(BRT_INTERNAL_H_INCLUDES)
|
2007-11-14 17:58:38 +00:00
|
|
|
brt-serialize-test.o: $(BRT_INTERNAL_H_INCLUDES)
|
2007-11-24 03:50:28 +00:00
|
|
|
brt.o: $(BRT_INTERNAL_H_INCLUDES) key.h log_header.h
|
2008-01-11 14:03:33 +00:00
|
|
|
fifo.o: fifo.h brttypes.h
|
2007-07-13 19:37:47 +00:00
|
|
|
memory.o: memory.h
|
2008-02-07 16:35:39 +00:00
|
|
|
primes.o: primes.h toku_assert.h
|
2008-04-09 18:52:03 +00:00
|
|
|
fifo-test: fifo.o memory.o toku_assert.o ybt.o
|
2007-11-14 17:58:38 +00:00
|
|
|
brt-serialize.o: $(BRT_INTERNAL_H_INCLUDES) key.h wbuf.h rbuf.h
|
2008-04-02 23:40:36 +00:00
|
|
|
brt-bigtest: memory.o ybt.o brt.o gpma.o cachetable.o key.o fifo.o brt-serialize.o
|
|
|
|
brt-bigtest.o: brt.h brt-search.h ../include/db.h
|
2008-04-04 18:03:03 +00:00
|
|
|
log-test6 log-test5 log-test4 log-test3 log-test2 log-test: log.o memory.o leafentry.o toku_assert.o roll.o log_code.o brt-serialize.o brt.o cachetable.o gpma.o ybt.o fifo.o key.o fingerprint.o brt-verify.o mempool.o primes.o
|
2007-11-14 17:58:38 +00:00
|
|
|
brt-verify.o: $(BRT_INTERNAL_H_INCLUDES)
|
|
|
|
fingerprint.o: $(BRT_INTERNAL_H_INCLUDES)
|
2008-04-02 23:40:36 +00:00
|
|
|
mempool.o: toku_assert.h mempool.h
|
2008-04-07 19:49:10 +00:00
|
|
|
leafentry.o: brttypes.h crc.h leafentry.h memory.h toku_assert.h
|
2008-02-07 16:35:39 +00:00
|
|
|
toku_assert.o: toku_assert.h
|
2007-11-14 17:58:38 +00:00
|
|
|
|
2008-04-04 18:03:03 +00:00
|
|
|
brt-serialize-test: brt-serialize-test.o brt-serialize.o leafentry.o memory.o fifo.o gpma.o key.o ybt.o brt.o cachetable.o primes.o toku_assert.o log.o mempool.o brt-verify.o fingerprint.o log_code.o roll.o
|
2008-02-08 03:17:38 +00:00
|
|
|
test_toku_malloc_plain_free: memory.o toku_assert.o
|
2007-07-13 19:37:47 +00:00
|
|
|
|
|
|
|
|
2007-10-05 14:46:49 +00:00
|
|
|
cachetable-test.o: cachetable.h memory.h
|
2008-04-17 03:11:55 +00:00
|
|
|
cachetable-test: $(OFILES)
|
2007-07-13 19:37:47 +00:00
|
|
|
|
2007-09-12 18:12:31 +00:00
|
|
|
cachetable-test2.o: cachetable.h memory.h
|
2008-04-17 03:11:55 +00:00
|
|
|
cachetable-test2: $(OFILES)
|
2007-09-12 18:12:31 +00:00
|
|
|
|
2008-04-04 18:03:03 +00:00
|
|
|
benchmark-test: $(OFILES)
|
2008-04-02 23:40:36 +00:00
|
|
|
benchmark-test.o: brt.h brt-search.h ../include/db.h
|
2007-08-01 20:53:18 +00:00
|
|
|
|
2008-02-07 16:35:39 +00:00
|
|
|
test-primes: test-primes.o toku_assert.o primes.o toku_assert.o toku_assert.o
|
|
|
|
|
|
|
|
test-assert: test-assert.o toku_assert.o
|
2008-01-17 19:35:12 +00:00
|
|
|
|
2008-04-04 18:03:03 +00:00
|
|
|
brtdump: $(OFILES)
|
2008-01-18 16:01:25 +00:00
|
|
|
|
2008-02-08 03:17:38 +00:00
|
|
|
test_oexcl: test_oexcl.o toku_assert.o
|
|
|
|
|
|
|
|
|
2007-12-06 20:52:23 +00:00
|
|
|
checko2:
|
|
|
|
ifeq ($(OPTFLAGS),-O2)
|
|
|
|
@echo OPTFLAGS=$(OPTFLAGS) ok
|
|
|
|
else
|
|
|
|
@echo OPTFLAGS=$(OPTFLAGS) bad; exit 1
|
|
|
|
endif
|
|
|
|
|
2007-07-13 19:37:47 +00:00
|
|
|
clean:
|
2008-04-03 20:24:47 +00:00
|
|
|
rm -rf $(BINS) *.o *.bb *.bbg *.da *.gcov *.gcno *.gcda
|
2008-01-02 11:37:16 +00:00
|
|
|
rm -rf test_oexcl.c.tmp *.brt
|
2007-07-13 19:37:47 +00:00
|
|
|
|
|
|
|
randdb4: LOADLIBES=-ldb
|
2008-02-08 03:17:38 +00:00
|
|
|
randdb4: randdb4.o toku_assert.o
|
2008-01-11 14:03:33 +00:00
|
|
|
randbrt: brt.o fifo.o cachetable.o memory.o brt-serialize.o
|
2008-01-22 19:30:02 +00:00
|
|
|
|
|
|
|
# After doing (cd ../src/tests;make test_log5.recover), run these. The files should have no differences.
|
|
|
|
testdump: brtdump
|
|
|
|
./brtdump ../src/tests/dir.test_log5.c.tdb.recover/foo.db > dump.r && ./brtdump ../src/tests/dir.test_log5.c.tdb/foo.db > dump.o && diff dump.o dump.r
|
|
|
|
|
2007-07-13 19:37:47 +00:00
|
|
|
TAGS: ../*/*.c ../*/*.h
|
|
|
|
etags ../*/*.c ../*/*.h
|