2007-09-22 00:28:50 +00:00
|
|
|
CFLAGS = -std=gnu89 -W -Wall -Wno-unused -g -fPIC -I /usr/local/Berkeleydb.4.1/include/ -ldb
|
2007-10-10 17:05:31 +00:00
|
|
|
LFLAGS = -l CPPFLAGS =
|
2007-09-15 00:24:48 +00:00
|
|
|
|
2007-09-21 23:33:40 +00:00
|
|
|
BDB_DUMP=/usr/local/Berkeleydb.4.1/bin/db_dump
|
|
|
|
BDB_LOAD=/usr/local/Berkeleydb.4.1/bin/db_load
|
2007-09-15 00:24:48 +00:00
|
|
|
|
2007-09-21 21:48:11 +00:00
|
|
|
UTILS= \
|
|
|
|
tokudb_gen \
|
|
|
|
tokudb_load \
|
|
|
|
# tokudb_dump \
|
2007-09-15 00:24:48 +00:00
|
|
|
#End
|
|
|
|
|
2007-10-10 17:05:31 +00:00
|
|
|
.PHONY: all clean test test_gen test_gen_hex test_load
|
2007-09-15 00:24:48 +00:00
|
|
|
|
|
|
|
all: $(UTILS)
|
|
|
|
|
2007-10-04 19:53:14 +00:00
|
|
|
test: test_gen test_load
|
2007-09-15 00:24:48 +00:00
|
|
|
|
|
|
|
test_gen: test_gen_hex
|
|
|
|
|
2007-09-18 20:38:47 +00:00
|
|
|
# SHELL=/bin/bash
|
2007-09-15 00:24:48 +00:00
|
|
|
|
2007-09-21 23:33:40 +00:00
|
|
|
BDB_LOAD=/usr/local/Berkeleydb.4.1/bin/db_load
|
|
|
|
BDB_DUMP=/usr/local/Berkeleydb.4.1/bin/db_dump
|
2007-09-15 00:24:48 +00:00
|
|
|
|
2007-09-21 23:33:40 +00:00
|
|
|
TEST_GEN_HEX_NUMKEYS=10000
|
|
|
|
TEST_GEN_HEX_LENGTHMIN=0
|
|
|
|
TEST_GEN_HEX_LENGTHLIMIT=1024
|
|
|
|
TEST_GEN_HEX_FLAGS=-n $(TEST_GEN_HEX_NUMKEYS) -m $(TEST_GEN_HEX_LENGTHMIN) -M $(TEST_GEN_HEX_LENGTHLIMIT) -r 5
|
2007-09-15 00:24:48 +00:00
|
|
|
|
|
|
|
test_gen_hex:
|
2007-09-21 23:33:40 +00:00
|
|
|
#Generating $(TEST_GEN_HEX_NUMKEYS) keys. [$(TEST_GEN_HEX_LENGTHMIN),$(TEST_GEN_HEX_LENGTHLIMIT)) bytes + identifier overhead
|
2007-09-15 00:24:48 +00:00
|
|
|
echo "Generating text input > db > text"
|
2007-09-21 23:33:40 +00:00
|
|
|
rm -f $@.*.temp
|
2007-10-09 16:24:05 +00:00
|
|
|
./tokudb_gen $(TEST_GEN_HEX_FLAGS) > $@.gen.temp
|
|
|
|
$(BDB_LOAD) $@.db.temp < $@.gen.temp
|
2007-09-19 15:24:20 +00:00
|
|
|
$(BDB_DUMP) $@.db.temp > $@.load_dump.temp
|
2007-09-21 21:48:11 +00:00
|
|
|
./tokudb_gen -Hf > $@.gen_sorted.temp
|
2007-09-21 23:33:40 +00:00
|
|
|
./tokudb_gen -hf $(TEST_GEN_HEX_FLAGS) -d "\t" -s "\n" | sort -k 1,1 | tr -d "\n" | tr "\t" "\n" >> $@.gen_sorted.temp
|
2007-09-21 21:48:11 +00:00
|
|
|
./tokudb_gen -Fh >> $@.gen_sorted.temp
|
2007-09-21 23:33:40 +00:00
|
|
|
if ! diff -q $@.load_dump.temp $@.gen_sorted.temp; then echo "Test Failed!"; exit 1; fi
|
2007-09-19 15:24:20 +00:00
|
|
|
rm $@.*.temp
|
2007-10-04 19:53:14 +00:00
|
|
|
|
2007-10-09 16:24:05 +00:00
|
|
|
test_load: test_gen
|
|
|
|
#Generating $(TEST_GEN_HEX_NUMKEYS) keys. [$(TEST_GEN_HEX_LENGTHMIN),$(TEST_GEN_HEX_LENGTHLIMIT)) bytes + identifier overhead
|
|
|
|
echo "Generating text input > db > text"
|
|
|
|
rm -f $@.*.temp
|
|
|
|
./tokudb_gen $(TEST_GEN_HEX_FLAGS) > $@.gen.temp
|
|
|
|
$(BDB_LOAD) $@.bdb.temp < $@.gen.temp
|
|
|
|
./tokudb_load $@.tokudb.temp < $@.gen.temp
|
|
|
|
$(BDB_DUMP) $@.bdb.temp > $@.dump.bdb.temp
|
|
|
|
$(BDB_DUMP) $@.tokudb.temp > $@.dump.tokudb.temp
|
|
|
|
if ! diff -q $@.dump.bdb.temp $@.dump.tokudb.temp; then echo "Test Failed!"; exit 1; fi
|
|
|
|
|
2007-09-15 00:24:48 +00:00
|
|
|
#if diff -q <(echo "foo") <(echo "foo") > /dev/null; then echo yes; else echo no; fi
|
|
|
|
clean:
|
2007-09-19 15:24:20 +00:00
|
|
|
rm -rf *.so *.o $(UTILS) *.temp
|
2007-09-15 00:24:48 +00:00
|
|
|
|