mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
Finish up the pretty output. Fixes #811.
git-svn-id: file:///svn/tokudb@3926 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
@@ -3,7 +3,8 @@ $(SHOULD_FAIL): MAYBEINVERTER=;test $$? -ne 0
|
|||||||
|
|
||||||
HERE = cxx/tests
|
HERE = cxx/tests
|
||||||
ifeq ($(SUMMARIZE),1)
|
ifeq ($(SUMMARIZE),1)
|
||||||
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sOK\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
|
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sPASS\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
|
||||||
|
$(SHOULD_FAIL): SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sXFAIL\n" $(HERE)/$@; else printf "%-60sXPASS\n" $(HERE)/$@ ; test 0 = 1; fi
|
||||||
else
|
else
|
||||||
SUMMARIZE_CMD =
|
SUMMARIZE_CMD =
|
||||||
endif
|
endif
|
||||||
@@ -52,7 +53,7 @@ check_test_cursor_count: test_cursor_count
|
|||||||
$(VGRIND) ./test_cursor_count $(MAYBEINVERTER) $(SUMMARIZE_CMD)
|
$(VGRIND) ./test_cursor_count $(MAYBEINVERTER) $(SUMMARIZE_CMD)
|
||||||
|
|
||||||
check_test_error_stream: test_error_stream
|
check_test_error_stream: test_error_stream
|
||||||
$(VGRIND) ./test_error_stream $(SUMMARIZE_CMD)
|
$(VGRIND) ./test_error_stream 2&> $@.out $(SUMMARIZE_CMD)
|
||||||
|
|
||||||
check_test1e: test1e
|
check_test1e: test1e
|
||||||
$(VGRIND) ./test1e > test1eactual.out && \
|
$(VGRIND) ./test1e > test1eactual.out && \
|
||||||
@@ -103,17 +104,17 @@ check_db_create_DSM: db_create
|
|||||||
$(VGRIND) ./db_create -D -S -s main $@.tdb $(SUMMARIZE_CMD)
|
$(VGRIND) ./db_create -D -S -s main $@.tdb $(SUMMARIZE_CMD)
|
||||||
|
|
||||||
check_db_create_1:
|
check_db_create_1:
|
||||||
$(VGRIND) ./db_create; test $$? -ne 0 $(SUMMARIZE_CMD)
|
$(VGRIND) ./db_create > $@.out ; test $$? -ne 0 $(SUMMARIZE_CMD)
|
||||||
check_db_create_2:
|
check_db_create_2:
|
||||||
$(VGRIND) ./db_create -h; test $$? -ne 0 $(SUMMARIZE_CMD)
|
$(VGRIND) ./db_create -h 2&> $@.out ; test $$? -ne 0 $(SUMMARIZE_CMD)
|
||||||
check_db_create_3:
|
check_db_create_3:
|
||||||
$(VGRIND) ./db_create --help; test $$? -ne 0 $(SUMMARIZE_CMD)
|
$(VGRIND) ./db_create --help 2&> $@.out; test $$? -ne 0 $(SUMMARIZE_CMD)
|
||||||
check_db_create_4:
|
check_db_create_4:
|
||||||
$(VGRIND) ./db_create -s; test $$? -ne 0 $(SUMMARIZE_CMD)
|
$(VGRIND) ./db_create -s 2&> $@.out ; test $$? -ne 0 $(SUMMARIZE_CMD)
|
||||||
|
|
||||||
check_permissions:
|
check_permissions:
|
||||||
rm -f permissions.tdb
|
rm -f permissions.tdb
|
||||||
./db_create permissions.tdb 1 1 && \
|
./db_create permissions.tdb 1 1 && \
|
||||||
chmod -w permissions.tdb && \
|
chmod -w permissions.tdb && \
|
||||||
(./db_create permissions.tdb 2 2; test $$? -ne 0) \
|
(./db_create permissions.tdb 2 2 2&> check_permissions.out; test $$? -ne 0) \
|
||||||
$(SUMMARIZE_CMD)
|
$(SUMMARIZE_CMD)
|
||||||
|
|||||||
@@ -22,16 +22,25 @@ TARGET_BDB = db-benchmark-test-bdb
|
|||||||
TARGET_TDB = db-benchmark-test-tokudb
|
TARGET_TDB = db-benchmark-test-tokudb
|
||||||
TARGETS = $(TARGET_BDB) $(TARGET_TDB)
|
TARGETS = $(TARGET_BDB) $(TARGET_TDB)
|
||||||
|
|
||||||
|
HERE = db-benchmark-test-cxx
|
||||||
|
ifeq ($(SUMMARIZE),1)
|
||||||
|
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sPASS\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
|
||||||
|
QUIET = -q
|
||||||
|
else
|
||||||
|
SUMMARIZE_CMD =
|
||||||
|
QUIET =
|
||||||
|
endif
|
||||||
|
|
||||||
default: build
|
default: build
|
||||||
build: $(TARGETS)
|
build: $(TARGETS)
|
||||||
|
|
||||||
check: check-default
|
check: check-default
|
||||||
|
|
||||||
check-default: $(TARGET_TDB)
|
check-default: $(TARGET_TDB)
|
||||||
$(VALGRIND) ./$(TARGET_TDB)
|
$(VALGRIND) ./$(TARGET_TDB) $(QUIET) $(SUMMARIZE_CMD)
|
||||||
|
|
||||||
check-x: $(TARGET_TDB)
|
check-x: $(TARGET_TDB)
|
||||||
$(VALGRIND) ./$(TARGET_TDB) -x
|
$(VALGRIND) ./$(TARGET_TDB) -x $(QUIET) $(SUMMARIZE_CMD)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(TARGETS) $(BENCHDBS) *.gcno *.gcda *.gcov
|
rm -rf $(TARGETS) $(BENCHDBS) *.gcno *.gcda *.gcov
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ enum { BOUND_INCREASE_PER_ITERATION = SERIAL_SPACING*ITEMS_TO_INSERT_PER_ITERATI
|
|||||||
|
|
||||||
#define CKERR(r) if (r!=0) fprintf(stderr, "%s:%d error %d %s\n", __FILE__, __LINE__, r, db_strerror(r)); assert(r==0);
|
#define CKERR(r) if (r!=0) fprintf(stderr, "%s:%d error %d %s\n", __FILE__, __LINE__, r, db_strerror(r)); assert(r==0);
|
||||||
|
|
||||||
|
int verbose = 1;
|
||||||
|
|
||||||
/* default test parameters */
|
/* default test parameters */
|
||||||
int keysize = sizeof (long long);
|
int keysize = sizeof (long long);
|
||||||
int valsize = sizeof (long long);
|
int valsize = sizeof (long long);
|
||||||
@@ -185,13 +187,15 @@ void biginsert (long long n_elements, struct timeval *starttime) {
|
|||||||
gettimeofday(&t1,0);
|
gettimeofday(&t1,0);
|
||||||
serial_insert_from(i);
|
serial_insert_from(i);
|
||||||
gettimeofday(&t2,0);
|
gettimeofday(&t2,0);
|
||||||
printf("serial %9.6fs %8.0f/s ", tdiff(&t2, &t1), ITEMS_TO_INSERT_PER_ITERATION/tdiff(&t2, &t1));
|
if (verbose) printf("serial %9.6fs %8.0f/s ", tdiff(&t2, &t1), ITEMS_TO_INSERT_PER_ITERATION/tdiff(&t2, &t1));
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
gettimeofday(&t1,0);
|
gettimeofday(&t1,0);
|
||||||
random_insert_below((i+ITEMS_TO_INSERT_PER_ITERATION)*SERIAL_SPACING);
|
random_insert_below((i+ITEMS_TO_INSERT_PER_ITERATION)*SERIAL_SPACING);
|
||||||
gettimeofday(&t2,0);
|
gettimeofday(&t2,0);
|
||||||
printf("random %9.6fs %8.0f/s ", tdiff(&t2, &t1), ITEMS_TO_INSERT_PER_ITERATION/tdiff(&t2, &t1));
|
if (verbose) {
|
||||||
printf("cumulative %9.6fs %8.0f/s\n", tdiff(&t2, starttime), (ITEMS_TO_INSERT_PER_ITERATION*2.0/tdiff(&t2, starttime))*(iteration+1));
|
printf("random %9.6fs %8.0f/s ", tdiff(&t2, &t1), ITEMS_TO_INSERT_PER_ITERATION/tdiff(&t2, &t1));
|
||||||
|
printf("cumulative %9.6fs %8.0f/s\n", tdiff(&t2, starttime), (ITEMS_TO_INSERT_PER_ITERATION*2.0/tdiff(&t2, starttime))*(iteration+1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -220,6 +224,11 @@ int main (int argc, const char *argv[]) {
|
|||||||
const char *arg = argv[i];
|
const char *arg = argv[i];
|
||||||
if (arg[0] != '-')
|
if (arg[0] != '-')
|
||||||
break;
|
break;
|
||||||
|
if (strcmp(arg, "-q") == 0) {
|
||||||
|
verbose--;
|
||||||
|
if (verbose<0) verbose=0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (strcmp(arg, "-x") == 0) {
|
if (strcmp(arg, "-x") == 0) {
|
||||||
do_transactions = 1;
|
do_transactions = 1;
|
||||||
continue;
|
continue;
|
||||||
@@ -266,15 +275,17 @@ int main (int argc, const char *argv[]) {
|
|||||||
}
|
}
|
||||||
total_n_items = ITEMS_TO_INSERT_PER_ITERATION * (long long)n_iterations;
|
total_n_items = ITEMS_TO_INSERT_PER_ITERATION * (long long)n_iterations;
|
||||||
}
|
}
|
||||||
printf("Serial and random insertions of %d per batch%s\n", ITEMS_TO_INSERT_PER_ITERATION, do_transactions ? " (with transactions)" : "");
|
if (verbose) printf("Serial and random insertions of %d per batch%s\n", ITEMS_TO_INSERT_PER_ITERATION, do_transactions ? " (with transactions)" : "");
|
||||||
setup();
|
setup();
|
||||||
gettimeofday(&t1,0);
|
gettimeofday(&t1,0);
|
||||||
biginsert(total_n_items, &t1);
|
biginsert(total_n_items, &t1);
|
||||||
gettimeofday(&t2,0);
|
gettimeofday(&t2,0);
|
||||||
shutdown();
|
shutdown();
|
||||||
gettimeofday(&t3,0);
|
gettimeofday(&t3,0);
|
||||||
printf("Shutdown %9.6fs\n", tdiff(&t3, &t2));
|
if (verbose) {
|
||||||
printf("Total time %9.6fs for %lld insertions = %8.0f/s\n", tdiff(&t3, &t1), 2*total_n_items, 2*total_n_items/tdiff(&t3, &t1));
|
printf("Shutdown %9.6fs\n", tdiff(&t3, &t2));
|
||||||
|
printf("Total time %9.6fs for %lld insertions = %8.0f/s\n", tdiff(&t3, &t1), 2*total_n_items, 2*total_n_items/tdiff(&t3, &t1));
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,15 @@
|
|||||||
# build with TokuDB: make BDBDIR=~/svn/tokudb
|
# build with TokuDB: make BDBDIR=~/svn/tokudb
|
||||||
# build with g++: make CC=g++
|
# build with g++: make CC=g++
|
||||||
|
|
||||||
|
HERE = db-benchmark-test
|
||||||
|
ifeq ($(SUMMARIZE),1)
|
||||||
|
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sPASS\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
|
||||||
|
QUIET = -q
|
||||||
|
else
|
||||||
|
SUMMARIZE_CMD =
|
||||||
|
QUIET =
|
||||||
|
endif
|
||||||
|
|
||||||
BENCHDBS = bench.bdb/ bench.tokudb
|
BENCHDBS = bench.bdb/ bench.tokudb
|
||||||
|
|
||||||
OPTFLAGS = -O2
|
OPTFLAGS = -O2
|
||||||
@@ -31,15 +40,15 @@ build: $(TARGETS)
|
|||||||
check: check-default check-xfast
|
check: check-default check-xfast
|
||||||
|
|
||||||
check-default: $(TARGET_TDB)
|
check-default: $(TARGET_TDB)
|
||||||
$(VGRIND) ./$(TARGET_TDB)
|
$(VGRIND) ./$(TARGET_TDB) $(QUIET) $(SUMMARIZE_CMD)
|
||||||
|
|
||||||
check-x: $(TARGET_TDB)
|
check-x: $(TARGET_TDB)
|
||||||
$(VGRIND) ./$(TARGET_TDB) -x
|
$(VGRIND) ./$(TARGET_TDB) $(QUIET) -x $(SUMMARIZE_CMD)
|
||||||
|
|
||||||
|
|
||||||
# A fast transaction test that detects #455.
|
# A fast transaction test that detects #455.
|
||||||
check-xfast: $(TARGET_TDB)
|
check-xfast: $(TARGET_TDB)
|
||||||
./$(TARGET_TDB) --noserial -x --valsize 1000 --cachesize 8000000 --xcount 1000 --periter 20000 --env xfast.dir 1
|
./$(TARGET_TDB) $(QUIET) --noserial -x --valsize 1000 --cachesize 8000000 --xcount 1000 --periter 20000 --env xfast.dir 1 $(SUMMARIZE_CMD)
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
#define DB_YESOVERWRITE 0
|
#define DB_YESOVERWRITE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int verbose=1;
|
||||||
|
|
||||||
enum { SERIAL_SPACING = 1<<6 };
|
enum { SERIAL_SPACING = 1<<6 };
|
||||||
enum { DEFAULT_ITEMS_TO_INSERT_PER_ITERATION = 1<<20 };
|
enum { DEFAULT_ITEMS_TO_INSERT_PER_ITERATION = 1<<20 };
|
||||||
enum { DEFAULT_ITEMS_PER_TRANSACTION = 1<<14 };
|
enum { DEFAULT_ITEMS_PER_TRANSACTION = 1<<14 };
|
||||||
@@ -200,16 +202,16 @@ void biginsert (long long n_elements, struct timeval *starttime) {
|
|||||||
gettimeofday(&t1,0);
|
gettimeofday(&t1,0);
|
||||||
serial_insert_from(i);
|
serial_insert_from(i);
|
||||||
gettimeofday(&t2,0);
|
gettimeofday(&t2,0);
|
||||||
printf("serial %9.6fs %8.0f/s ", tdiff(&t2, &t1), items_per_iteration/tdiff(&t2, &t1));
|
if (verbose) printf("serial %9.6fs %8.0f/s ", tdiff(&t2, &t1), items_per_iteration/tdiff(&t2, &t1));
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
if (!norandom) {
|
if (!norandom) {
|
||||||
gettimeofday(&t1,0);
|
gettimeofday(&t1,0);
|
||||||
random_insert_below((i+items_per_iteration)*SERIAL_SPACING);
|
random_insert_below((i+items_per_iteration)*SERIAL_SPACING);
|
||||||
gettimeofday(&t2,0);
|
gettimeofday(&t2,0);
|
||||||
printf("random %9.6fs %8.0f/s ", tdiff(&t2, &t1), items_per_iteration/tdiff(&t2, &t1));
|
if (verbose) printf("random %9.6fs %8.0f/s ", tdiff(&t2, &t1), items_per_iteration/tdiff(&t2, &t1));
|
||||||
}
|
}
|
||||||
printf("cumulative %9.6fs %8.0f/s\n", tdiff(&t2, starttime), (((float)items_per_iteration*(!noserial+!norandom))/tdiff(&t2, starttime))*(iteration+1));
|
if (verbose) printf("cumulative %9.6fs %8.0f/s\n", tdiff(&t2, starttime), (((float)items_per_iteration*(!noserial+!norandom))/tdiff(&t2, starttime))*(iteration+1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -246,7 +248,9 @@ int main (int argc, const char *argv[]) {
|
|||||||
const char *arg = argv[i];
|
const char *arg = argv[i];
|
||||||
if (arg[0] != '-')
|
if (arg[0] != '-')
|
||||||
break;
|
break;
|
||||||
if (strcmp(arg, "-x") == 0) {
|
if (strcmp(arg, "-q") == 0) {
|
||||||
|
verbose--; if (verbose<0) verbose=0;
|
||||||
|
} else if (strcmp(arg, "-x") == 0) {
|
||||||
do_transactions = 1;
|
do_transactions = 1;
|
||||||
env_open_flags += DB_INIT_TXN | DB_INIT_LOG | DB_INIT_LOCK;
|
env_open_flags += DB_INIT_TXN | DB_INIT_LOG | DB_INIT_LOCK;
|
||||||
} else if (strcmp(arg, "--DB_INIT_TXN") == 0) {
|
} else if (strcmp(arg, "--DB_INIT_TXN") == 0) {
|
||||||
@@ -308,19 +312,23 @@ int main (int argc, const char *argv[]) {
|
|||||||
}
|
}
|
||||||
total_n_items = items_per_iteration * (long long)n_iterations;
|
total_n_items = items_per_iteration * (long long)n_iterations;
|
||||||
}
|
}
|
||||||
if (!noserial) printf("serial ");
|
if (verbose) {
|
||||||
if (!noserial && !norandom) printf("and ");
|
if (!noserial) printf("serial ");
|
||||||
if (!norandom) printf("random ");
|
if (!noserial && !norandom) printf("and ");
|
||||||
printf("insertions of %d per batch%s\n", items_per_iteration, do_transactions ? " (with transactions)" : "");
|
if (!norandom) printf("random ");
|
||||||
|
printf("insertions of %d per batch%s\n", items_per_iteration, do_transactions ? " (with transactions)" : "");
|
||||||
|
}
|
||||||
setup();
|
setup();
|
||||||
gettimeofday(&t1,0);
|
gettimeofday(&t1,0);
|
||||||
biginsert(total_n_items, &t1);
|
biginsert(total_n_items, &t1);
|
||||||
gettimeofday(&t2,0);
|
gettimeofday(&t2,0);
|
||||||
shutdown();
|
shutdown();
|
||||||
gettimeofday(&t3,0);
|
gettimeofday(&t3,0);
|
||||||
printf("Shutdown %9.6fs\n", tdiff(&t3, &t2));
|
if (verbose) {
|
||||||
printf("Total time %9.6fs for %lld insertions = %8.0f/s\n", tdiff(&t3, &t1),
|
printf("Shutdown %9.6fs\n", tdiff(&t3, &t2));
|
||||||
(!noserial+!norandom)*total_n_items, (!noserial+!norandom)*total_n_items/tdiff(&t3, &t1));
|
printf("Total time %9.6fs for %lld insertions = %8.0f/s\n", tdiff(&t3, &t1),
|
||||||
|
(!noserial+!norandom)*total_n_items, (!noserial+!norandom)*total_n_items/tdiff(&t3, &t1));
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ endif
|
|||||||
HERE=newbrt/tests
|
HERE=newbrt/tests
|
||||||
|
|
||||||
ifeq ($(SUMMARIZE),1)
|
ifeq ($(SUMMARIZE),1)
|
||||||
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sOK\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
|
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sPASS\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
|
||||||
else
|
else
|
||||||
SUMMARIZE_CMD =
|
SUMMARIZE_CMD =
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -75,17 +75,11 @@ foo:
|
|||||||
|
|
||||||
.PHONY: check check.bdb check.tdb
|
.PHONY: check check.bdb check.tdb
|
||||||
check: check.tdb test_db_assoc3.tdbrun_wasbad check.bdb
|
check: check.tdb test_db_assoc3.tdbrun_wasbad check.bdb
|
||||||
@ echo ok $@
|
|
||||||
tests: tests.bdb tests.tdb
|
tests: tests.bdb tests.tdb
|
||||||
@ echo ok $@
|
|
||||||
tests.bdb: $(BDB_TESTS)
|
tests.bdb: $(BDB_TESTS)
|
||||||
@ echo ok $@
|
|
||||||
check.bdb: $(RUN_BDB_TESTS)
|
check.bdb: $(RUN_BDB_TESTS)
|
||||||
@ echo ok $@
|
|
||||||
tests.tdb: $(TDB_TESTS)
|
tests.tdb: $(TDB_TESTS)
|
||||||
@ echo ok $@
|
|
||||||
check.tdb: $(RUN_TDB_TESTS) all.recover
|
check.tdb: $(RUN_TDB_TESTS) all.recover
|
||||||
@ echo ok $@
|
|
||||||
|
|
||||||
# Need these rule so that Make knows about all the file names
|
# Need these rule so that Make knows about all the file names
|
||||||
.PHONY: %.run
|
.PHONY: %.run
|
||||||
@@ -108,9 +102,16 @@ else
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
SHOULD_FAIL = $(TDB_TESTS_THAT_SHOULD_FAIL_LIT) $(patsubst %,%.tdbrun,$(TDB_TESTS_THAT_SHOULD_FAIL))
|
||||||
|
|
||||||
|
# Any test that should fail, we invert the result by using MAYBEINVERTER
|
||||||
|
$(SHOULD_FAIL): MAYBEINVERTER=;test $$? -ne 0
|
||||||
|
|
||||||
HERE = src/tests
|
HERE = src/tests
|
||||||
ifeq ($(SUMMARIZE),1)
|
ifeq ($(SUMMARIZE),1)
|
||||||
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sOK\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
|
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sPASS\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
|
||||||
|
$(SHOULD_FAIL): SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sXFAIL\n" $(HERE)/$@; else printf "%-60sXPASS\n" $(HERE)/$@ ; test 0 = 1; fi
|
||||||
else
|
else
|
||||||
SUMMARIZE_CMD =
|
SUMMARIZE_CMD =
|
||||||
endif
|
endif
|
||||||
@@ -121,9 +122,6 @@ endif
|
|||||||
%.tdbrun: %.tdb ../libtokudb.$(LIBEXT)
|
%.tdbrun: %.tdb ../libtokudb.$(LIBEXT)
|
||||||
$(SETTOKUENV) $(VGRIND) ./$< $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
|
$(SETTOKUENV) $(VGRIND) ./$< $(VERBVERBOSE) $(MAYBEINVERTER) $(SUMMARIZE_CMD)
|
||||||
|
|
||||||
# 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
|
# Don't include log2 log3 log4 log5 etc since they are covered by all.recover
|
||||||
|
|
||||||
# Don't run valgrind on the groupcommit performance tests
|
# Don't run valgrind on the groupcommit performance tests
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ static void commit_items (DB_ENV *env, int UU(i)) {
|
|||||||
int vi=*(int*)v.data;
|
int vi=*(int*)v.data;
|
||||||
assert(ki==vi);
|
assert(ki==vi);
|
||||||
//printf(" del %u\n", ki);
|
//printf(" del %u\n", ki);
|
||||||
committed->del(committed, txn, dbt_init(&k, &ki, sizeof(ki)), DB_AUTO_COMMIT);
|
committed->del(committed, txn, dbt_init(&k, &ki, sizeof(ki)), 0);
|
||||||
delete_in_mem(ki, &com_count, com_data);
|
delete_in_mem(ki, &com_count, com_data);
|
||||||
// ignore result from that del
|
// ignore result from that del
|
||||||
r=pending_d->del(pending_d, txn, &k, 0);
|
r=pending_d->del(pending_d, txn, &k, 0);
|
||||||
|
|||||||
115
utils/Makefile
115
utils/Makefile
@@ -44,6 +44,14 @@ UTILS= \
|
|||||||
BDB_UTILS=$(patsubst %,%.bdb,$(UTILS))
|
BDB_UTILS=$(patsubst %,%.bdb,$(UTILS))
|
||||||
STATIC_UTILS=$(patsubst %,%_static,$(UTILS))
|
STATIC_UTILS=$(patsubst %,%_static,$(UTILS))
|
||||||
|
|
||||||
|
HERE=utils
|
||||||
|
|
||||||
|
ifeq ($(SUMMARIZE),1)
|
||||||
|
SUMMARIZE_CMD = ;if test $$? = 0; then printf "%-60sPASS\n" $(HERE)/$@; else printf "%-60sFAIL\n" $(HERE)/$@ ; test 0 = 1; fi
|
||||||
|
else
|
||||||
|
SUMMARIZE_CMD =
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: all clean test test_gen test_gen_hex test_load test_dump
|
.PHONY: all clean test test_gen test_gen_hex test_load test_dump
|
||||||
|
|
||||||
build all: $(UTILS) $(BDB_UTILS) $(STATIC_UTILS)
|
build all: $(UTILS) $(BDB_UTILS) $(STATIC_UTILS)
|
||||||
@@ -75,83 +83,88 @@ TEST_GEN_HEX_FLAGS=-n $(TEST_GEN_HEX_NUMKEYS) -m $(TEST_GEN_HEX_LENGTHMIN) -M $(
|
|||||||
|
|
||||||
test_gen_hex:
|
test_gen_hex:
|
||||||
#Generating $(TEST_GEN_HEX_NUMKEYS) keys. [$(TEST_GEN_HEX_LENGTHMIN),$(TEST_GEN_HEX_LENGTHLIMIT)) bytes + identifier overhead
|
#Generating $(TEST_GEN_HEX_NUMKEYS) keys. [$(TEST_GEN_HEX_LENGTHMIN),$(TEST_GEN_HEX_LENGTHLIMIT)) bytes + identifier overhead
|
||||||
@echo "Generating text input > db > text"
|
@#echo "Generating text input > db > text"
|
||||||
rm -f $@.*.temp
|
rm -f $@.*.temp
|
||||||
./tokudb_gen $(TEST_GEN_HEX_FLAGS) > $@.gen.temp
|
./tokudb_gen $(TEST_GEN_HEX_FLAGS) > $@.gen.temp && \
|
||||||
$(UNSETTOKUENV) $(BDB_LOAD) $@.db.temp < $@.gen.temp
|
$(UNSETTOKUENV) $(BDB_LOAD) $@.db.temp < $@.gen.temp && \
|
||||||
$(UNSETTOKUENV) $(BDB_DUMP) $@.db.temp > $@.load_dump.temp
|
$(UNSETTOKUENV) $(BDB_DUMP) $@.db.temp > $@.load_dump.temp && \
|
||||||
./tokudb_gen -Hf > $@.gen_sorted.temp
|
./tokudb_gen -Hf > $@.gen_sorted.temp && \
|
||||||
export LC_ALL=C;./tokudb_gen -hf $(TEST_GEN_HEX_FLAGS) -d "\t" -s "\n" | sort -k 1,1 | tr -d "\n" | tr "\t" "\n" >> $@.gen_sorted.temp
|
export LC_ALL=C;./tokudb_gen -hf $(TEST_GEN_HEX_FLAGS) -d "\t" -s "\n" | sort -k 1,1 | tr -d "\n" | tr "\t" "\n" >> $@.gen_sorted.temp && \
|
||||||
./tokudb_gen -Fh >> $@.gen_sorted.temp
|
./tokudb_gen -Fh >> $@.gen_sorted.temp && \
|
||||||
if ! $(DIFF) -q $@.load_dump.temp $@.gen_sorted.temp; then echo "Test Failed!"; exit 1; fi
|
$(DIFF) -q $@.load_dump.temp $@.gen_sorted.temp \
|
||||||
rm $@.*.temp
|
$(SUMMARIZE_CMD)
|
||||||
|
|
||||||
test_load: test_load_hex test_load_text
|
test_load: test_load_hex test_load_text test_load_text_noendline
|
||||||
|
|
||||||
test_load_hex:
|
test_load_hex:
|
||||||
#Generating $(TEST_GEN_HEX_NUMKEYS) keys. [$(TEST_GEN_HEX_LENGTHMIN),$(TEST_GEN_HEX_LENGTHLIMIT)) bytes + identifier overhead
|
#Generating $(TEST_GEN_HEX_NUMKEYS) keys. [$(TEST_GEN_HEX_LENGTHMIN),$(TEST_GEN_HEX_LENGTHLIMIT)) bytes + identifier overhead
|
||||||
@echo "Generating text input > db > text"
|
@#echo "Generating text input > db > text"
|
||||||
rm -f $@.*.temp
|
rm -f $@.*.temp
|
||||||
./tokudb_gen $(TEST_GEN_HEX_FLAGS) > $@.gen.temp
|
./tokudb_gen $(TEST_GEN_HEX_FLAGS) > $@.gen.temp && \
|
||||||
$(UNSETTOKUENV) $(BDB_LOAD) $@.bdb.temp < $@.gen.temp
|
$(UNSETTOKUENV) $(BDB_LOAD) $@.bdb.temp < $@.gen.temp && \
|
||||||
$(SETTOKUENV) ./tokudb_load $@.tokudb.temp < $@.gen.temp
|
$(SETTOKUENV) ./tokudb_load $@.tokudb.temp < $@.gen.temp && \
|
||||||
$(UNSETTOKUENV) $(BDB_DUMP) $@.bdb.temp > $@.dump.bdb.temp
|
$(UNSETTOKUENV) $(BDB_DUMP) $@.bdb.temp > $@.dump.bdb.temp && \
|
||||||
$(SETTOKUENV) ./tokudb_dump $@.tokudb.temp > $@.dump.tokudb.temp
|
$(SETTOKUENV) ./tokudb_dump $@.tokudb.temp > $@.dump.tokudb.temp && \
|
||||||
if ! $(DIFF) -q $@.dump.bdb.temp $@.dump.tokudb.temp; then echo "Test Failed!"; exit 1; fi
|
$(DIFF) -q $@.dump.bdb.temp $@.dump.tokudb.temp \
|
||||||
|
$(SUMMARIZE_CMD)
|
||||||
|
|
||||||
TEST_GEN_TEXT_FLAGS=-n $(TEST_GEN_HEX_NUMKEYS) -m $(TEST_GEN_HEX_LENGTHMIN) -M $(TEST_GEN_HEX_LENGTHLIMIT) -r 5 -TP
|
TEST_GEN_TEXT_FLAGS=-n $(TEST_GEN_HEX_NUMKEYS) -m $(TEST_GEN_HEX_LENGTHMIN) -M $(TEST_GEN_HEX_LENGTHLIMIT) -r 5 -TP
|
||||||
|
|
||||||
test_load_text: test_load_text_noendline
|
test_load_text:
|
||||||
#Generating $(TEST_GEN_HEX_NUMKEYS) keys. [$(TEST_GEN_HEX_LENGTHMIN),$(TEST_GEN_HEX_LENGTHLIMIT)) bytes + identifier overhead
|
#Generating $(TEST_GEN_HEX_NUMKEYS) keys. [$(TEST_GEN_HEX_LENGTHMIN),$(TEST_GEN_HEX_LENGTHLIMIT)) bytes + identifier overhead
|
||||||
@echo "Generating text input > db > text"
|
@#echo "Generating text input > db > text"
|
||||||
rm -f $@.*.temp
|
rm -f $@.*.temp
|
||||||
./tokudb_gen $(TEST_GEN_TEXT_FLAGS) > $@.gen.temp
|
./tokudb_gen $(TEST_GEN_TEXT_FLAGS) > $@.gen.temp && \
|
||||||
$(UNSETTOKUENV) $(BDB_LOAD) -T -t btree $@.bdb.temp < $@.gen.temp
|
$(UNSETTOKUENV) $(BDB_LOAD) -T -t btree $@.bdb.temp < $@.gen.temp && \
|
||||||
$(SETTOKUENV) ./tokudb_load -T -t btree $@.tokudb.temp < $@.gen.temp
|
$(SETTOKUENV) ./tokudb_load -T -t btree $@.tokudb.temp < $@.gen.temp && \
|
||||||
$(UNSETTOKUENV) $(BDB_DUMP) -p $@.bdb.temp > $@.dump.bdb.temp
|
$(UNSETTOKUENV) $(BDB_DUMP) -p $@.bdb.temp > $@.dump.bdb.temp && \
|
||||||
$(SETTOKUENV) ./tokudb_dump -p $@.tokudb.temp > $@.dump.tokudb.temp
|
$(SETTOKUENV) ./tokudb_dump -p $@.tokudb.temp > $@.dump.tokudb.temp && \
|
||||||
if ! $(DIFF) -q $@.dump.bdb.temp $@.dump.tokudb.temp; then echo "Test Failed!"; exit 1; fi
|
$(DIFF) -q $@.dump.bdb.temp $@.dump.tokudb.temp \
|
||||||
|
$(SUMMARIZE_CMD)
|
||||||
|
|
||||||
test_load_text_noendline:
|
test_load_text_noendline:
|
||||||
@echo "Testing no end of line at end of file."
|
@#echo "Testing no end of line at end of file."
|
||||||
rm -f $@.*.temp
|
rm -f $@.*.temp
|
||||||
echo -en "key\nvalue" > $@.gen.temp
|
echo -en "key\nvalue" > $@.gen.temp
|
||||||
./tokudb_load -T -t btree $@.tokudb.temp < $@.gen.temp
|
./tokudb_load -T -t btree $@.tokudb.temp < $@.gen.temp $(SUMMARIZE_CMD)
|
||||||
|
|
||||||
|
|
||||||
test_dump:
|
test_dump:
|
||||||
#Generating $(TEST_GEN_HEX_NUMKEYS) keys. [$(TEST_GEN_HEX_LENGTHMIN),$(TEST_GEN_HEX_LENGTHLIMIT)) bytes + identifier overhead
|
#Generating $(TEST_GEN_HEX_NUMKEYS) keys. [$(TEST_GEN_HEX_LENGTHMIN),$(TEST_GEN_HEX_LENGTHLIMIT)) bytes + identifier overhead
|
||||||
echo "Generating text input > db > text"
|
@#echo "Generating text input > db > text"
|
||||||
rm -f $@.*.temp
|
rm -f $@.*.temp
|
||||||
./tokudb_gen $(TEST_GEN_HEX_FLAGS) > $@.gen.temp
|
./tokudb_gen $(TEST_GEN_HEX_FLAGS) > $@.gen.temp && \
|
||||||
$(UNSETTOKUENV) $(BDB_LOAD) $@.bdb.temp < $@.gen.temp
|
$(UNSETTOKUENV) $(BDB_LOAD) $@.bdb.temp < $@.gen.temp && \
|
||||||
$(UNSETTOKUENV) $(BDB_DUMP) $@.bdb.temp > $@.dump.bdb.temp
|
$(UNSETTOKUENV) $(BDB_DUMP) $@.bdb.temp > $@.dump.bdb.temp && \
|
||||||
$(UNSETTOKUENV) ./tokudb_dump.bdb $@.bdb.temp > $@.dump.tokudb.temp
|
$(UNSETTOKUENV) ./tokudb_dump.bdb $@.bdb.temp > $@.dump.tokudb.temp && \
|
||||||
if ! $(DIFF) -q $@.dump.bdb.temp $@.dump.tokudb.temp; then echo "Test Failed!"; exit 1; fi
|
$(DIFF) -q $@.dump.bdb.temp $@.dump.tokudb.temp \
|
||||||
|
$(SUMMARIZE_CMD)
|
||||||
|
|
||||||
test_nodup:
|
test_nodup:
|
||||||
rm -rf $@.*.temp
|
rm -rf $@.*.temp
|
||||||
./tokudb_gen $(TEST_GEN_HEX_FLAGS) >$@.gen.temp
|
./tokudb_gen $(TEST_GEN_HEX_FLAGS) >$@.gen.temp && \
|
||||||
$(UNSETTOKUENV) $(BDB_LOAD) $@.bdb.temp <$@.gen.temp
|
$(UNSETTOKUENV) $(BDB_LOAD) $@.bdb.temp <$@.gen.temp && \
|
||||||
$(UNSETTOKUENV) $(BDB_DUMP) $@.bdb.temp >$@.dump.bdb.temp
|
$(UNSETTOKUENV) $(BDB_DUMP) $@.bdb.temp >$@.dump.bdb.temp && \
|
||||||
$(SETTOKUENV) ./tokudb_load $@.tdb.temp <$@.gen.temp
|
$(SETTOKUENV) ./tokudb_load $@.tdb.temp <$@.gen.temp && \
|
||||||
$(SETTOKUENV) ./tokudb_dump $@.tdb.temp >$@.dump.tdb.temp
|
$(SETTOKUENV) ./tokudb_dump $@.tdb.temp >$@.dump.tdb.temp && \
|
||||||
if ! $(DIFF) -q $@.dump.bdb.temp $@.dump.tdb.temp; then echo "$@ failed"; exit 1; fi
|
$(DIFF) -q $@.dump.bdb.temp $@.dump.tdb.temp && \
|
||||||
$(SETTOKUENV) ./tokudb_load_static $@.tdb.temp <$@.gen.temp
|
$(SETTOKUENV) ./tokudb_load_static $@.tdb.temp <$@.gen.temp && \
|
||||||
$(SETTOKUENV) ./tokudb_dump_static $@.tdb.temp >$@.dump.tdb.temp
|
$(SETTOKUENV) ./tokudb_dump_static $@.tdb.temp >$@.dump.tdb.temp && \
|
||||||
if ! $(DIFF) -q $@.dump.bdb.temp $@.dump.tdb.temp; then echo "$@ failed"; exit 1; fi
|
$(DIFF) -q $@.dump.bdb.temp $@.dump.tdb.temp \
|
||||||
|
$(SUMMARIZE_CMD)
|
||||||
|
|
||||||
test_dupsort:
|
test_dupsort:
|
||||||
rm -rf $@.*.temp
|
rm -rf $@.*.temp
|
||||||
./tokudb_gen $(TEST_GEN_HEX_FLAGS) -DS >$@.gen.temp
|
./tokudb_gen $(TEST_GEN_HEX_FLAGS) -DS >$@.gen.temp && \
|
||||||
$(UNSETTOKUENV) $(BDB_LOAD) $@.bdb.temp <$@.gen.temp
|
$(UNSETTOKUENV) $(BDB_LOAD) $@.bdb.temp <$@.gen.temp && \
|
||||||
$(UNSETTOKUENV) $(BDB_DUMP) $@.bdb.temp >$@.dump.bdb.temp
|
$(UNSETTOKUENV) $(BDB_DUMP) $@.bdb.temp >$@.dump.bdb.temp && \
|
||||||
$(SETTOKUENV) ./tokudb_load $@.tdb.temp <$@.gen.temp
|
$(SETTOKUENV) ./tokudb_load $@.tdb.temp <$@.gen.temp && \
|
||||||
$(SETTOKUENV) ./tokudb_dump $@.tdb.temp >$@.dump.tdb.temp
|
$(SETTOKUENV) ./tokudb_dump $@.tdb.temp >$@.dump.tdb.temp && \
|
||||||
if ! $(DIFF) -q $@.dump.bdb.temp $@.dump.tdb.temp; then echo "$@ failed"; exit 1; fi
|
$(DIFF) -q $@.dump.bdb.temp $@.dump.tdb.temp && \
|
||||||
$(SETTOKUENV) ./tokudb_load_static $@.tdb.temp <$@.gen.temp
|
$(SETTOKUENV) ./tokudb_load_static $@.tdb.temp <$@.gen.temp && \
|
||||||
$(SETTOKUENV) ./tokudb_dump_static $@.tdb.temp >$@.dump.tdb.temp
|
$(SETTOKUENV) ./tokudb_dump_static $@.tdb.temp >$@.dump.tdb.temp && \
|
||||||
if ! $(DIFF) -q $@.dump.bdb.temp $@.dump.tdb.temp; then echo "$@ failed"; exit 1; fi
|
$(DIFF) -q $@.dump.bdb.temp $@.dump.tdb.temp \
|
||||||
|
$(SUMMARIZE_CMD)
|
||||||
|
|
||||||
#if $(DIFF) -q <(echo "foo") <(echo "foo") > /dev/null; then echo yes; else echo no; fi
|
#if $(DIFF) -q <(echo "foo") <(echo "foo") > /dev/null; then echo yes; else echo no; fi
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
Reference in New Issue
Block a user