Commit 10fb98e4 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Quiet down the src/tests. Addresses #13.

git-svn-id: file:///svn/tokudb@1331 c7de825b-a66e-492c-adef-691d508d4ae1
parent 3439a6a2
......@@ -76,21 +76,22 @@ $(ALL_TESTS):
ifeq ($(VERBOSE),2)
VERBVERBOSE=-v
MAYBEATSIGN=
else
ifeq ($(VERBOSE),1)
VERBVERBOSE=
MAYBEATSIGN=
else
VERBVERBOSE=
MAYBEATSIGN=@
endif
endif
# The @ sign makes the make quiet. If there is an error there is enough info to tell what test failed.
%.bdbrun: %.bdb
ifdef VERBOSE
$(UNSETTOKUENV) $(VGRIND) $(BDB_SUPPRESSIONS) ./$< $(VERBVERBOSE)
else
@ $(UNSETTOKUENV) $(VGRIND) $(BDB_SUPPRESSIONS) ./$<
endif
$(MAYBEATSIGN) $(UNSETTOKUENV) $(VGRIND) $(BDB_SUPPRESSIONS) ./$< $(VERBVERBOSE)
%.tdbrun: %.tdb
ifdef VERBOSE
$(SETTOKUENV) $(VGRIND) ./$< $(VERBVERBOSE)
else
@ $(SETTOKUENV) $(VGRIND) ./$<
endif
$(MAYBEATSIGN) $(SETTOKUENV) $(VGRIND) ./$<
# For a few of the tests bdb is making valgrind unhappy.
FOO_NO_VGRIND = \
......@@ -115,6 +116,9 @@ FOO_NO_VGRIND = \
# Comment to terminate list so the previous line can end with a slash
NO_VGRIND = \
db_dbt_appmalloc \
db_dbt_mem_behavior \
db_assoc3 \
db_curs2 \
db_env_open_nocreate \
db_env_open_open_close \
......@@ -133,12 +137,12 @@ $(patsubst %,test_%.bdbrun,$(NO_VGRIND)): BDB_SUPPRESSIONS=
.PHONY: %.recover
all.recover: test_log2.recover test_log3.recover test_log4.recover
%.recover: %.tdb
cd ../../newbrt;make recover
./$<
rm -rf dir.$(patsubst %.tdb,%.c.tdb,$<).recover
mkdir dir.$(patsubst %.tdb,%.c.tdb,$<).recover
cd dir.$(patsubst %.tdb,%.c.tdb,$<).recover;../../../newbrt/recover ../dir.$(patsubst %.tdb,%.c.tdb,$<)
diff dir.$(patsubst %.tdb,%.c.tdb,$<) dir.$(patsubst %.tdb,%.c.tdb,$<).recover/foo.db
$(MAYBEATSIGN) cd ../../newbrt;make --quiet recover
$(MAYBEATSIGN) ./$<
$(MAYBEATSIGN) rm -rf dir.$(patsubst %.tdb,%.c.tdb,$<).recover
$(MAYBEATSIGN) mkdir dir.$(patsubst %.tdb,%.c.tdb,$<).recover
$(MAYBEATSIGN) cd dir.$(patsubst %.tdb,%.c.tdb,$<).recover;../../../newbrt/recover ../dir.$(patsubst %.tdb,%.c.tdb,$<)
$(MAYBEATSIGN) diff dir.$(patsubst %.tdb,%.c.tdb,$<) dir.$(patsubst %.tdb,%.c.tdb,$<).recover/foo.db
make_libs:
cd ..;make
......@@ -154,18 +158,18 @@ test_db_assoc3.tdb test_db_assoc3.bdb: test.h
# This one failed in both BDB and TokuDB, in the same way. It was a program error. Now it works
test_db_assoc3.tdbrun_wasbad: test_db_assoc3.tdb
./test_db_assoc3.tdb --seed=1 --count=200
./test_db_assoc3.tdb --seed=1 --count=200 --more
./test_db_assoc3.tdb --seed=1 --count=200 --more
./test_db_assoc3.tdb --seed=1 --count=200 --more
./test_db_assoc3.tdb --seed=1 --count=200 --more
./test_db_assoc3.tdb --seed=1 --count=200 --more
./test_db_assoc3.tdb --seed=1 --count=200 --more
$(MAYBEATSIGN) ./test_db_assoc3.tdb --seed=1 --count=200
$(MAYBEATSIGN) ./test_db_assoc3.tdb --seed=1 --count=200 --more
$(MAYBEATSIGN) ./test_db_assoc3.tdb --seed=1 --count=200 --more
$(MAYBEATSIGN) ./test_db_assoc3.tdb --seed=1 --count=200 --more
$(MAYBEATSIGN) ./test_db_assoc3.tdb --seed=1 --count=200 --more
$(MAYBEATSIGN) ./test_db_assoc3.tdb --seed=1 --count=200 --more
$(MAYBEATSIGN) ./test_db_assoc3.tdb --seed=1 --count=200 --more
test_db_assoc3.tdbrun: test_db_assoc3.tdb
$(VGRIND) ./test_db_assoc3.tdb --seed=2 --count=100000 $(VERBVERBOSE)
$(VGRIND) ./test_db_assoc3.tdb --seed=2 --count=100000 --more $(VERBVERBOSE)
$(MAYBEATSIGN) $(VGRIND) ./test_db_assoc3.tdb --seed=2 --count=100000 $(VERBVERBOSE)
$(MAYBEATSIGN) $(VGRIND) ./test_db_assoc3.tdb --seed=2 --count=100000 --more $(VERBVERBOSE)
test_db_assoc3.bdbrun: test_db_assoc3.bdb
$(VGRIND) ./test_db_assoc3.bdb --seed=2 --count=100000 $(VERBVERBOSE)
$(VGRIND) ./test_db_assoc3.bdb --seed=2 --count=100000 --more $(VERBVERBOSE)
$(MAYBEATSIGN) $(VGRIND) ./test_db_assoc3.bdb --seed=2 --count=100000 $(VERBVERBOSE)
$(MAYBEATSIGN) $(VGRIND) ./test_db_assoc3.bdb --seed=2 --count=100000 --more $(VERBVERBOSE)
......@@ -458,7 +458,7 @@ void activity (void) {
void usage (const char *argv1) {
fprintf(stderr, "Usage:\n %s [ --DB-CREATE | --more ] seed ", argv1);
fprintf(stderr, "Usage:\n %s [ --DB-CREATE | --more ] [-v] seed\n", argv1);
exit(1);
}
......@@ -488,6 +488,8 @@ int main (int argc, const char *argv[]) {
mode = MODE_DB_CREATE;
} else if (strcmp(argv[0], "--more")==0) {
mode = MODE_MORE;
} else if (strcmp(argv[0], "-v")==0) {
verbose = 1;
} else {
errno=0;
char *endptr;
......@@ -499,7 +501,7 @@ int main (int argc, const char *argv[]) {
argc--; argv++;
}
printf("seed=%d\n", useseed);
if (verbose) printf("seed=%d\n", useseed);
srandom(useseed);
switch (mode) {
......
......@@ -196,7 +196,7 @@ static void gettod (timestamp *ts) {
static int oppass, opnum;
static void insert_person (void) {
printf("insert_person\n");
if (verbose) printf("insert_person\n");
struct primary_key pk;
struct primary_data pd;
char keyarray[1000], dataarray[1000];
......@@ -204,7 +204,7 @@ static void insert_person (void) {
if (oppass==0 && opnum==1) pk.rand = 42;
else if (oppass==0 && opnum==2) pk.rand = 43;
else { assert(0); }
printf("oppass=%d opnum=%d pk.rand=%d\n", oppass, opnum, pk.rand);
//printf("oppass=%d opnum=%d pk.rand=%d\n", oppass, opnum, pk.rand);
gettod(&pd.creationtime);
pd.expiretime = pd.creationtime;
pd.expiretime += 24*60*60*366;
......@@ -214,7 +214,7 @@ static void insert_person (void) {
else if (oppass==0 && opnum==2) pd.name.name[0] = 'E';
else assert(0);
pd.name.name[1] = 0;
printf("name = %s\n", pd.name.name);
//printf("name = %s\n", pd.name.name);
DBT key,data;
memset(&key,0,sizeof(DBT));
memset(&data,0,sizeof(DBT));
......@@ -262,7 +262,7 @@ static void delete_oldest_expired (void) {
static void step_name (void) {
int r;
if (name_cursor==0) {
printf("%s:%d %d.%d namedb->cursor()\n", __FILE__, __LINE__, opnum, oppass);
if (verbose) printf("%s:%d %d.%d namedb->cursor()\n", __FILE__, __LINE__, opnum, oppass);
r = namedb->cursor(namedb, null_txn, &name_cursor, 0); CKERR(r);
}
r = name_cursor->c_get(name_cursor, &nc_key, &nc_data, DB_NEXT); // an uninitialized cursor does a DB_FIRST.
......@@ -271,7 +271,7 @@ static void step_name (void) {
printf("%s:%d Found %c ccount=%d\n", __FILE__, __LINE__, *(char*)nc_key.data, cursor_count_n_items);
} else if (r==DB_NOTFOUND) {
// Got to the end.
printf("%s:%d Got to end count=%d curscount=%d\n", __FILE__, __LINE__, calc_n_items, cursor_count_n_items);
if (verbose) printf("%s:%d Got to end count=%d curscount=%d\n", __FILE__, __LINE__, calc_n_items, cursor_count_n_items);
assert(cursor_count_n_items==calc_n_items);
r = name_cursor->c_get(name_cursor, &nc_key, &nc_data, DB_FIRST);
if (r==DB_NOTFOUND) {
......@@ -296,7 +296,7 @@ static void activity (void) {
} else {
if ((oppass==0 && opnum==1) ||
(oppass==0 && opnum==2)) {
printf("%s:%d r2 says insert oppass==%d opnum==%d\n", __FILE__, __LINE__, oppass, opnum);
if (verbose) printf("%s:%d r2 says insert oppass==%d opnum==%d\n", __FILE__, __LINE__, oppass, opnum);
insert_person();
} else {
step_name();
......@@ -307,7 +307,7 @@ static void activity (void) {
static void usage (const char *argv1) {
fprintf(stderr, "Usage:\n %s [ --DB-CREATE | --more ] seed ", argv1);
fprintf(stderr, "Usage:\n %s [ --DB-CREATE | --more ] [-v] seed\n", argv1);
exit(1);
}
......@@ -329,13 +329,15 @@ int main (int argc, const char *argv[]) {
while (argc>0) {
if (strcmp(argv[0], "--more")==0) {
mode = MODE_MORE;
} else if (strcmp(argv[0], "-v")==0) {
verbose = 1;
} else {
usage(progname);
}
argc--; argv++;
}
printf("seed=%d\n", useseed);
if (verbose) printf("seed=%d\n", useseed);
srandom(useseed);
switch (mode) {
......
......@@ -30,7 +30,7 @@ void test_dup_flags(int dup_flags) {
r = db->set_flags(db, dup_flags);
#if USE_TDB
if (r != 0 && dup_flags == DB_DUP) {
printf("%s:%d: WARNING: tokudb does not support DB_DUP\n", __FILE__, __LINE__);
if (verbose) printf("%s:%d: WARNING: tokudb does not support DB_DUP\n", __FILE__, __LINE__);
r = db->close(db, 0); assert(r == 0);
return;
}
......@@ -46,7 +46,7 @@ void test_dup_flags(int dup_flags) {
assert(r == 0);
r = db->open(db, null_txn, fname, "main", DB_BTREE, 0, 0666);
#if USE_BDB
if (r == 0)
if (r == 0 && verbose)
printf("%s:%d: WARNING:open ok:dup_mode:%d\n", __FILE__, __LINE__, dup_flags);
#else
assert(r != 0);
......
......@@ -24,7 +24,7 @@ void test_env_open_flags(int env_open_flags, int expectr) {
assert(r == 0);
r = env->open(env, DIR, env_open_flags, 0644);
if (r != expectr) printf("env open flags=%x expectr=%d r=%d\n", env_open_flags, expectr, r);
if (r != expectr && verbose) printf("env open flags=%x expectr=%d r=%d\n", env_open_flags, expectr, r);
r = env->close(env, 0);
assert(r == 0);
......
......@@ -284,7 +284,8 @@ static int toku_db_env_open(DB_ENV * env, const char *home, u_int32_t flags, int
if (!(flags & DB_PRIVATE)) {
fprintf(stderr, "tokudb requires DB_PRIVATE\n");
// There is no good place to send this error message.
// fprintf(stderr, "tokudb requires DB_PRIVATE\n");
// This means that we don't have to do anything with shared memory.
// And that's good enough for mysql.
return EINVAL;
......
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