2008-05-08 20:30:33 +00:00
# On cygwin do:
# make CYGWIN=cygwin check
# For verbose output do
# make VERBOSE=1
# For very verbose output do
# make VERBOSE=2
# GCOV_FLAGS = -fprofile-arcs -ftest-coverage
# PROF_FLAGS = -pg
OPTFLAGS = -O3
i f e q ( $( VERBOSE ) , 2 )
VERBVERBOSE = -v
e l s e
ifeq ( $( VERBOSE) ,1)
VERBVERBOSE = -q
else
VERBVERBOSE = -q
endif
e n d i f
2008-07-24 21:24:27 +00:00
i f n e q ( $( CYGWIN ) , )
FORMAT = -Wno-format
CYG_ADD_LIBZ = /usr/lib/libz.a
2008-05-08 20:30:33 +00:00
e l s e
FPICFLAGS = -fPIC
# valgrind is not present on cygwin
2013-04-16 23:57:17 -04:00
VGRIND = valgrind --quiet --error-exitcode= 1 --leak-check= yes --suppressions= ../valgrind.suppressions
2008-07-24 21:24:27 +00:00
VISIBILITY = -fvisibility= hidden
2013-04-16 23:57:19 -04:00
ifneq ( $( CC) ,icc)
SHADOW = -Wshadow
FORMAT = -Wmissing-format-attribute
endif
2008-05-08 20:30:33 +00:00
e n d i f
2013-04-16 23:57:20 -04:00
CFLAGS = -Wall $( FORMAT) $( OPTFLAGS) $( GCOV_FLAGS) $( PROF_FLAGS) $( FPICFLAGS) $( SHADOW) $( VISIBILITY)
2013-04-16 23:57:19 -04:00
i f n e q ( $( CC ) , i c c )
2013-04-16 23:57:20 -04:00
CFLAGS += -Werror -Wextra -Wcast-align -Wbad-function-cast -Wmissing-noreturn -g3 -ggdb3
2013-04-16 23:57:19 -04:00
e l s e
2013-04-16 23:57:20 -04:00
CFLAGS += -Werror
2013-04-16 23:57:19 -04:00
CFLAGS += -g
CFLAGS += -diag-disable 177 # Don't complain about static variables that are not used.
CFLAGS += -diag-disable 981 # Don't complain about "operands are evaluated in unspecified order". This seems to be generated whenever more than one argument to a function or operand is computed by function call.
e n d i f
2013-04-16 23:57:16 -04:00
LDFLAGS = $( OPTFLAGS) -g $( GCOV_FLAGS) $( PROF_FLAGS) -lpthread -lz
2008-08-22 17:50:05 +00:00
CPPFLAGS += -D_FILE_OFFSET_BITS= 64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE= 500 -D_GNU_SOURCE -I..
2008-07-24 21:24:27 +00:00
# Add -Wconversion
2008-05-12 10:58:07 +00:00
HERE = newbrt/tests
i f e q ( $( SUMMARIZE ) , 1 )
2008-05-13 02:35:50 +00:00
SUMMARIZE_CMD = ; if test $$ ? = 0; then printf "%-60sPASS\n" $( HERE) /$@ ; else printf "%-60sFAIL\n" $( HERE) /$@ ; test 0 = 1; fi
2008-05-12 10:58:07 +00:00
e l s e
SUMMARIZE_CMD =
e n d i f
2008-05-08 20:30:33 +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.
REGRESSION_TESTS = \
2013-04-16 23:57:18 -04:00
block_allocator_test \
2008-07-09 12:00:26 +00:00
bread-test \
2008-05-08 20:30:33 +00:00
brt-serialize-test \
brt-test \
brt-test-cursor \
brt-test-cursor-2 \
brt-test-named-db \
brt-test0 \
brt-test1 \
brt-test2 \
brt-test3 \
brt-test4 \
brt-test5 \
2013-04-16 23:57:17 -04:00
cachetable-rwlock-test \
cachetable-writequeue-test \
threadpool-test \
2008-05-08 20:30:33 +00:00
cachetable-test \
cachetable-test2 \
2008-08-22 17:50:05 +00:00
cachetable-put-test \
2013-04-16 23:57:18 -04:00
cachetable-getandpin-test \
2008-08-22 17:50:05 +00:00
cachetable-unpin-test \
cachetable-rename-test \
cachetable-fd-test \
2008-08-26 14:07:27 +00:00
cachetable-flush-test \
2008-08-22 17:50:05 +00:00
cachetable-count-pinned-test \
2013-04-16 23:57:17 -04:00
cachetable-debug-test \
2013-04-16 23:57:18 -04:00
cachetable-debug-test \
2008-05-08 20:30:33 +00:00
fifo-test \
list-test \
2008-05-13 12:14:38 +00:00
keyrange \
2008-05-13 12:27:07 +00:00
keyrange-unflat \
2008-05-13 20:29:19 +00:00
keyrange-dupsort \
keyrange-dupsort-unflat \
2008-05-08 20:30:33 +00:00
log-test \
log-test2 \
log-test3 \
log-test4 \
log-test5 \
log-test6 \
2008-05-08 21:01:17 +00:00
memtest \
2008-06-02 20:52:12 +00:00
omt-cursor-test \
2008-05-08 20:30:33 +00:00
omt-test \
2008-06-02 20:52:12 +00:00
shortcut \
2008-05-08 20:30:33 +00:00
test-assert \
test-brt-delete-both \
test-brt-overflow \
test-del-inorder \
test-inc-split \
2008-05-29 03:12:59 +00:00
test-leafentry \
2008-05-08 20:30:33 +00:00
test_oexcl \
test_toku_malloc_plain_free \
2008-07-27 22:16:49 +00:00
x1764-test \
2008-05-08 20:30:33 +00:00
ybt-test \
# This line intentially kept commented so I can have a \ on the end of the previous line
# Add in the binaries that must be run in various ways.
BINS = $( REGRESSION_TESTS) \
benchmark-test \
2008-07-23 11:24:13 +00:00
cachetable-scan \
2008-05-08 20:30:33 +00:00
# This line intentially kept commented so I can have a \ on the end of the previous line
CHECKS = \
benchmarktest_256 \
2008-05-12 10:58:07 +00:00
test-assertA test-assertB \
2008-05-08 20:30:33 +00:00
$( REGRESSION_TESTS) \
# This line intentially kept commented so I can have a \ on the previous line
build : $( BINS )
foo :
echo $( BINS)
check : $( patsubst %,check_ %,$ ( CHECKS ) )
2008-05-12 10:58:07 +00:00
check_fail :
test 0 = 1 $( SUMMARIZE_CMD)
check_ok :
test 0 = 0 $( SUMMARIZE_CMD)
2008-05-08 20:30:33 +00:00
check_benchmarktest_256 : benchmark -test
2008-05-12 10:58:07 +00:00
$( VGRIND) ./benchmark-test $( VERBVERBOSE) --valsize 256 --verify 1 $( SUMMARIZE_CMD)
2008-05-08 20:30:33 +00:00
2008-05-12 10:58:07 +00:00
check_test-assertA : test -assert
2008-05-08 20:30:33 +00:00
@# no arguments, should err
2008-05-12 10:58:07 +00:00
$( VGRIND) ./test-assert > /dev/null 2>& 1 ; test $$ ? = 1 $( SUMMARIZE_CMD)
check_test-assertB : test -assert
2008-05-08 20:30:33 +00:00
@# one argument, not "ok" should err
2008-05-12 10:58:07 +00:00
@rm -f test-assert.out
( $( VGRIND) ./test-assert notok) > test-assert.out 2>& 1 ; test $$ ? = 1 && fgrep failed test-assert.out > /dev/null $( SUMMARIZE_CMD)
check_test-assertC : tst -assert
check_test-assert : test -assert
2008-05-08 20:30:33 +00:00
@# one argument, "ok" should not error
2008-05-12 10:58:07 +00:00
$( DVGRIND) ./test-assert ok $( SUMMARIZE_CMD)
2008-05-08 20:30:33 +00:00
check_% : %
2008-05-12 10:58:07 +00:00
$( VGRIND) ./$< $( VERBVERBOSE) $( SUMMARIZE_CMD)
2008-05-08 20:30:33 +00:00
benchmark-test.o : ../brt .h ../brt -search .h ../../include /db .h
2008-07-24 21:24:27 +00:00
$(BINS) : ../newbrt .o $( CYG_ADD_LIBZ )
2008-05-08 20:30:33 +00:00
test-inc-split test-del-inorder : ../brt -test -helpers .o
clean :
rm -rf $( BINS) *.o *.bb *.bbg *.da *.gcov *.gcno *.gcda
2008-05-12 10:58:07 +00:00
rm -rf test_oexcl.c.tmp *.brt *.dir *.tdb *.dat *.out