Commit a02ed246 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Most of the work for making the checks output nice easy-to-read output.

Not quite all the output is pretty yet.  To get the pretty output set the {{{SUMMARIZE}}} make variable to nonzero and use the {{{-s}}} argument.  E.g.,
{{{
make check SUMMARIZE=1 -s
}}}
.
a complete useful invokation on Coyote is as follows:
{{{
make check SUMMARIZE=1 BDBDIR=/usr -s -j8 VGRIND= -k
}}}

Also, (almost) all the tests pass (even the recovery tests that really fail), since those tests won't really work until after milestone:"MySQL TokuDB Beta 1.0.2".
The one test that fails is {{{check_test_cursor_count}}}.  Perhaps we won't fix that for this release either.

Addresses #810, #811.


git-svn-id: file:///svn/tokudb@3917 c7de825b-a66e-492c-adef-691d508d4ae1
parent 875d146a
......@@ -38,10 +38,11 @@ CHECKS = $(patsubst %,checkdir_%,$(SRCDIRS))
checkdir_%:
cd $(patsubst checkdir_%,%,$@) ; $(MAKE) -k check
check: $(CHECKS)
summarize: SUMMARIZE=1
summarize: VERBOSE=0
summarize: check
foo:
echo $(MAKEFLAGS)
check: $(CHECKS)
clean:
for d in $(SRCDIRS); do (cd $$d; $(MAKE) -k clean); done
......
......@@ -146,7 +146,10 @@ else
@echo OPTFLAGS=$(OPTFLAGS) bad; exit 1
endif
clean:
clean: clean-local clean-tests
clean-tests:
cd tests;$(MAKE) clean
clean-local:
rm -rf $(BINS) *.o *.bb *.bbg *.da *.gcov *.gcno *.gcda
rm -rf test_oexcl.c.tmp *.brt
......
......@@ -12,14 +12,11 @@ OPTFLAGS = -O3
ifeq ($(VERBOSE),2)
VERBVERBOSE=-v
MAYBEATSIGN=
else
ifeq ($(VERBOSE),1)
VERBVERBOSE=-q
MAYBEATSIGN=
else
VERBVERBOSE=-q
MAYBEATSIGN=@
endif
endif
......@@ -30,6 +27,14 @@ FPICFLAGS = -fPIC
VGRIND = valgrind --quiet --error-exitcode=1 --leak-check=yes
endif
HERE=newbrt/tests
ifeq ($(SUMMARIZE),1)
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sOK\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
else
SUMMARIZE_CMD =
endif
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
LDFLAGS = $(OPTFLAGS) -g $(GCOV_FLAGS) $(PROF_FLAGS) -lz
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=500 -I..
......@@ -78,6 +83,7 @@ BINS = $(REGRESSION_TESTS) \
CHECKS = \
benchmarktest_256 \
test-assertA test-assertB \
$(REGRESSION_TESTS) \
# This line intentially kept commented so I can have a \ on the previous line
......@@ -86,21 +92,31 @@ foo:
echo $(BINS)
check: $(patsubst %,check_%,$(CHECKS))
check_fail:
test 0 = 1 $(SUMMARIZE_CMD)
check_ok:
test 0 = 0 $(SUMMARIZE_CMD)
check_benchmarktest_256: benchmark-test
$(VGRIND) ./benchmark-test $(VERBVERBOSE) --valsize 256 --verify 1
$(VGRIND) ./benchmark-test $(VERBVERBOSE) --valsize 256 --verify 1 $(SUMMARIZE_CMD)
check_test-assert: test-assert
check_test-assertA: test-assert
@# no arguments, should err
$(VGRIND) ./test-assert > /dev/null 2>&1 ; test \($$?\)
$(VGRIND) ./test-assert > /dev/null 2>&1 ; test $$? = 1 $(SUMMARIZE_CMD)
check_test-assertB: test-assert
@# one argument, not "ok" should err
@echo Expect an abort message:
($(VGRIND) ./test-assert notok) > test-assert.out 2>&1 ; test \($$?\)
@fgrep failed test-assert.out > /dev/null
@rm test-assert.out
@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
@# one argument, "ok" should not error
$(DVGRIND) ./test-assert ok
$(DVGRIND) ./test-assert ok $(SUMMARIZE_CMD)
check_%: %
$(VGRIND) ./$< $(VERBVERBOSE)
$(VGRIND) ./$< $(VERBVERBOSE) $(SUMMARIZE_CMD)
benchmark-test.o: ../brt.h ../brt-search.h ../../include/db.h
$(BINS): ../newbrt.o
......@@ -109,5 +125,4 @@ test-inc-split test-del-inorder: ../brt-test-helpers.o
clean:
rm -rf $(BINS) *.o *.bb *.bbg *.da *.gcov *.gcno *.gcda
rm -rf test_oexcl.c.tmp *.brt
rm -rf test_oexcl.c.tmp *.brt *.dir *.tdb *.dat *.out
......@@ -55,6 +55,7 @@ BDB_DONTRUN = bug627 test_abort1
BDB_TESTS = $(patsubst %.c,%.bdb,$(filter-out $(patsubst %,%.c,$(BDB_DONTRUN)),$(SRCS)))
TDB_TESTS_THAT_SHOULD_FAIL = test_groupcommit_count
TDB_TESTS_THAT_SHOULD_FAIL_LIT = test_log5.recover test_log7.recover test_log10.recover
ALL_TESTS = $(TDB_TESTS) $(BDB_TESTS)
......@@ -96,33 +97,32 @@ $(ALL_TESTS):
ifeq ($(VERBOSE),2)
VERBVERBOSE=-v
MAYBEATSIGN=
VERBQUIET=
else
ifeq ($(VERBOSE),1)
VERBVERBOSE=
MAYBEATSIGN=
VERBQUIET=
else
VERBVERBOSE=
MAYBEATSIGN=@
VERBQUIET=--quiet
endif
endif
# The @ sign makes the make quiet. If there is an error there is enough info to tell what test failed.
# Give up VGRIND of bdbrun
# It was this:
#%.bdbrun: %.bdb
# $(MAYBEATSIGN) $(UNSETTOKUENV) $(VGRIND) $(BDB_SUPPRESSIONS) ./$< $(VERBVERBOSE)
# Now this:
HERE = src/tests
ifeq ($(SUMMARIZE),1)
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sOK\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
else
SUMMARIZE_CMD =
endif
# Use -s on the command line to make things quiet.
%.bdbrun: %.bdb ../libtokudb.$(LIBEXT)
$(MAYBEATSIGN) $(UNSETTOKUENV) ./$< $(VERBVERBOSE)
$(UNSETTOKUENV) ./$< $(VERBVERBOSE) $(SUMMARIZE_CMD)
%.tdbrun: %.tdb ../libtokudb.$(LIBEXT)
$(MAYBEATSIGN) $(SETTOKUENV) $(VGRIND) ./$< $(VERBVERBOSE) $(MAYBEINVERTERR)
$(SETTOKUENV) $(VGRIND) ./$< $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
# Any test that should fail, we invert the result by using MAYBEINVERTERR
$(patsubst %,%.tdbrun,$(TDB_TESTS_THAT_SHOULD_FAIL)): MAYBEINVERTERR=;test $$? -ne 0
# Any test that should fail, we invert the result by using MAYBEINVERTER
$(TDB_TESTS_THAT_SHOULD_FAIL_LIT) $(patsubst %,%.tdbrun,$(TDB_TESTS_THAT_SHOULD_FAIL)): MAYBEINVERTER=;test $$? -ne 0
# Don't include log2 log3 log4 log5 etc since they are covered by all.recover
......@@ -131,7 +131,7 @@ test_groupcommit_perf.bdbrun test_groupcommit_perf.tdbrun: VGRIND=
# Use helgrind on the group commit count test
# helgrind is too flakey, so I'm removing it from the tests. -Bradley
#test_groupcommit_count_helgrind.tdbrun: test_groupcommit_count_helgrind.tdb
# $(MAYBEATSIGN) $(SETTOKUENV) $(HGRIND) ./$< $(VERBVERBOSE)
# $(SETTOKUENV) $(HGRIND) ./$< $(VERBVERBOSE)
......@@ -151,14 +151,15 @@ all.recover: $(patsubst %,test_log%.recover,$(TLRECOVER))
$(patsubst %,test_log%.tdbrun,$(TLRECOVER)):
@echo -n
%.recover: %.tdb
$(MAYBEATSIGN) $(SETTOKUENV) $(VGRIND) ./$<
$(MAYBEATSIGN) $(SETTOKUENV) rm -rf dir.$(patsubst %.tdb,%.c.tdb,$<).recover
$(MAYBEATSIGN) $(SETTOKUENV) mkdir dir.$(patsubst %.tdb,%.c.tdb,$<).recover
$(MAYBEATSIGN) $(SETTOKUENV) cd dir.$(patsubst %.tdb,%.c.tdb,$<).recover; $(VGRIND) ../../../newbrt/tdb-recover ../dir.$(patsubst %.tdb,%.c.tdb,$<)
$(MAYBEATSIGN) $(SETTOKUENV) diff dir.$(patsubst %.tdb,%.c.tdb,$<) dir.$(patsubst %.tdb,%.c.tdb,$<).recover/foo.db
$(SETTOKUENV) $(VGRIND) ./$< && \
$(SETTOKUENV) rm -rf dir.$(patsubst %.tdb,%.c.tdb,$<).recover && \
$(SETTOKUENV) mkdir dir.$(patsubst %.tdb,%.c.tdb,$<).recover && \
($(SETTOKUENV) cd dir.$(patsubst %.tdb,%.c.tdb,$<).recover; $(VGRIND) ../../../newbrt/tdb-recover ../dir.$(patsubst %.tdb,%.c.tdb,$<) ) && \
$(SETTOKUENV) diff dir.$(patsubst %.tdb,%.c.tdb,$<) dir.$(patsubst %.tdb,%.c.tdb,$<).recover/foo.db \
$(MAYBEINVERTER) $(SUMMARIZE_CMD)
%.recoverwc: %.tdb
$(MAYBEATSIGN) $(SETTOKUENV) (cd dir.$(patsubst %.tdb,%.c.tdb,$<);pwd;cat log*| ../../../newbrt/tdb_logprint |wc -c)
$(SETTOKUENV) (cd dir.$(patsubst %.tdb,%.c.tdb,$<);pwd;cat log*| ../../../newbrt/tdb_logprint |wc -c)
.PHONY: clean cleanall
......@@ -184,19 +185,17 @@ test_db_assoc3.tdbrun_wasbad: test_db_assoc3.tdb
$(MAYBEATSIGN) $(SETTOKUENV) ./test_db_assoc3.tdb --seed=1 --count=200 --more
$(MAYBEATSIGN) $(SETTOKUENV) ./test_db_assoc3.tdb --seed=1 --count=200 --more
$(MAYBEATSIGN) $(SETTOKUENV) ./test_db_assoc3.tdb --seed=1 --count=200 --more
@ touch $@
# serialize these two tests since they use the same directory
test_db_assoc3.tdbrun_wasbad: test_db_assoc3.tdbrun
test_db_assoc3.tdbrun: test_db_assoc3.tdb
$(MAYBEATSIGN) $(SETTOKUENV) $(VGRIND) ./test_db_assoc3.tdb --seed=2 --count=100000 $(VERBVERBOSE)
$(MAYBEATSIGN) $(SETTOKUENV) $(VGRIND) ./test_db_assoc3.tdb --seed=2 --count=100000 --more $(VERBVERBOSE)
@ touch $@
$(SETTOKUENV) $(VGRIND) ./test_db_assoc3.tdb --seed=2 --count=100000 $(VERBVERBOSE) && \
$(SETTOKUENV) $(VGRIND) ./test_db_assoc3.tdb --seed=2 --count=100000 --more $(VERBVERBOSE) $(SUMMARIZE_CMD)
# Give up on VGRIND for bdbrun
test_db_assoc3.bdbrun: test_db_assoc3.bdb
$(MAYBEATSIGN) $(UNSETTOKUENV) ./test_db_assoc3.bdb --seed=2 --count=100000 $(VERBVERBOSE)
$(MAYBEATSIGN) $(UNSETTOKUENV) ./test_db_assoc3.bdb --seed=2 --count=100000 --more $(VERBVERBOSE)
$(UNSETTOKUENV) ./test_db_assoc3.bdb --seed=2 --count=100000 $(VERBVERBOSE) && \
$(UNSETTOKUENV) ./test_db_assoc3.bdb --seed=2 --count=100000 --more $(VERBVERBOSE) $(SUMMARIZE_CMD)
# a bunch of little tests designed to run in parallel
test_get_both_range.tdbrun: \
......@@ -210,20 +209,20 @@ test_get_both_range.tdbrun: \
tgbr_2_a.tdbrun tgbr_2_b.tdbrun tgbr_2_c.tdbrun \
tgbr_1_a.tdbrun tgbr_1_b.tdbrun tgbr_1_c.tdbrun \
# intentionally blank line
echo Did $@
# echo Did $@
tgbr_%_a.tdbrun: test_get_both_range.tdb
$(MAYBEATSIGN) $(SETTOKUENV) $(VGRIND) ./$< $(VERBVERBOSE) -i $(patsubst tgbr_%_a.tdbrun,%,$@) -a $(MAYBEINVERTERR)
$(SETTOKUENV) $(VGRIND) ./$< $(VERBVERBOSE) -i $(patsubst tgbr_%_a.tdbrun,%,$@) -a $(MAYBEINVERTER) $(SUMMARIZE_CMD)
tgbr_%_b.tdbrun: test_get_both_range.tdb
$(MAYBEATSIGN) $(SETTOKUENV) $(VGRIND) ./$< $(VERBVERBOSE) -i $(patsubst tgbr_%_b.tdbrun,%,$@) -b $(MAYBEINVERTERR)
$(SETTOKUENV) $(VGRIND) ./$< $(VERBVERBOSE) -i $(patsubst tgbr_%_b.tdbrun,%,$@) -b $(MAYBEINVERTER) $(SUMMARIZE_CMD)
tgbr_%_c.tdbrun: test_get_both_range.tdb
$(MAYBEATSIGN) $(SETTOKUENV) $(VGRIND) ./$< $(VERBVERBOSE) -i $(patsubst tgbr_%_c.tdbrun,%,$@) -c $(MAYBEINVERTERR)
$(SETTOKUENV) $(VGRIND) ./$< $(VERBVERBOSE) -i $(patsubst tgbr_%_c.tdbrun,%,$@) -c $(MAYBEINVERTER) $(SUMMARIZE_CMD)
dumpit:
../../newbrt/brtdump dir.test_log5.c.tdb.recover/foo.db > dump.r && ../../newbrt/brtdump dir.test_log5.c.tdb/foo.db > dump.o && diff dump.o dump.r
# test on small stacks
test_thread_stack.%run: test_thread_stack.%
$(MAYBEATSIGN) $(UNSETTOKUENV) ./test_thread_stack.% -a -thread_stack 16384
$(MAYBEATSIGN) $(UNSETTOKUENV) ./test_thread_stack.% -a -thread_stack 16384 -resume
$(UNSETTOKUENV) ./test_thread_stack.% -a -thread_stack 16384 && \
$(UNSETTOKUENV) ./test_thread_stack.% -a -thread_stack 16384 -resume $(SUMMARIZE_CMD)
......@@ -87,7 +87,7 @@ void printtdiff (char *str) {
gettimeofday(&thistime, 0);
double tdiff = thistime.tv_sec-prevtime.tv_sec+1e-6*(thistime.tv_usec-prevtime.tv_usec);
int fcount=get_fsync_count();
printf("%s: %10.6fs %d fsyncs for %s\n", progname, tdiff, fcount-prev_count, str);
if (verbose) printf("%s: %10.6fs %d fsyncs for %s\n", progname, tdiff, fcount-prev_count, str);
prevtime=thistime;
prev_count=fcount;
}
......@@ -109,13 +109,13 @@ int main (int argc, const char *argv[]) {
int count_before_10 = get_fsync_count();
test_groupcommit(10); printtdiff("10 threads");
if (get_fsync_count()-count_before_10 >= 10*NITER) {
printf("It looks like too many fsyncs. Group commit doesn't appear to be occuring.\n");
if (verbose) printf("It looks like too many fsyncs. Group commit doesn't appear to be occuring.\n");
exit(1);
}
int count_before_20 = get_fsync_count();
test_groupcommit(20); printtdiff("20 threads");
if (get_fsync_count()-count_before_20 >= 20*NITER) {
printf("It looks like too many fsyncs. Group commit doesn't appear to be occuring.\n");
if (verbose) printf("It looks like too many fsyncs. Group commit doesn't appear to be occuring.\n");
exit(1);
}
return 0;
......
......@@ -86,7 +86,7 @@ struct timeval prevtime;
void printtdiff (char *str) {
struct timeval thistime;
gettimeofday(&thistime, 0);
printf("%10.6f %s\n", thistime.tv_sec-prevtime.tv_sec+1e-6*(thistime.tv_usec-prevtime.tv_usec), str);
if (verbose) printf("%10.6f %s\n", thistime.tv_sec-prevtime.tv_sec+1e-6*(thistime.tv_usec-prevtime.tv_usec), str);
}
int main (int argc, const char *argv[]) {
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
......@@ -12,7 +13,7 @@ void test_abort_close(void) {
#ifndef USE_TDB
#if DB_VERSION_MAJOR==4 && DB_VERSION_MINOR==3
fprintf(stderr, "%s does not work for BDB %d.%d. Not running\n", __FILE__, DB_VERSION_MAJOR, DB_VERSION_MINOR);
if (verbose) fprintf(stderr, "%s does not work for BDB %d.%d. Not running\n", __FILE__, DB_VERSION_MAJOR, DB_VERSION_MINOR);
return;
#endif
#endif
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
......@@ -12,7 +13,7 @@ void test_abort_close(void) {
#ifndef USE_TDB
#if DB_VERSION_MAJOR==4 && DB_VERSION_MINOR==3
fprintf(stderr, "%s does not work for BDB %d.%d. Not running\n", __FILE__, DB_VERSION_MAJOR, DB_VERSION_MINOR);
if (verbose) fprintf(stderr, "%s does not work for BDB %d.%d. Not running\n", __FILE__, DB_VERSION_MAJOR, DB_VERSION_MINOR);
return;
#endif
#endif
......
/* -*- mode: C; c-basic-offset: 4 -*- */
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
......@@ -12,7 +13,7 @@ void test_abort_close(void) {
#ifndef USE_TDB
#if DB_VERSION_MAJOR==4 && DB_VERSION_MINOR==3
fprintf(stderr, "%s does not work for BDB %d.%d. Not running\n", __FILE__, DB_VERSION_MAJOR, DB_VERSION_MINOR);
if (verbose) fprintf(stderr, "%s does not work for BDB %d.%d. Not running\n", __FILE__, DB_VERSION_MAJOR, DB_VERSION_MINOR);
return;
#endif
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment