Commit 11da3234 authored by Yoni Fogel's avatar Yoni Fogel

Cleaned up tests.

git-svn-id: file:///svn/tokudb@322 c7de825b-a66e-492c-adef-691d508d4ae1
parent 848be36d
......@@ -6,10 +6,10 @@ LFLAGS = -l CPPFLAGS = -I../include -I../newbrt
BDB_DUMP=/usr/local/BerkeleyDB.4.1/bin/db_dump
BDB_LOAD=/usr/local/BerkeleyDB.4.1/bin/db_load
UTILS= \
ydb_gen \
# ydb_dump \
# ydb_load \
UTILS= \
ydb_gen \
# ydb_load \
# ydb_dump \
#End
.PHONY: all clean test test_gen test_gen_hex
......@@ -25,21 +25,22 @@ test_gen: test_gen_hex
BDB_LOAD=/usr/local/BerkeleyDB.4.1/bin/db_load
BDB_DUMP=/usr/local/BerkeleyDB.4.1/bin/db_dump
TEST_GEN_HEX_FLAGS=-n 1000 -m 0 -M 1024 -r 5
TEST_GEN_HEX_FLAGS=-n 10000 -m 0 -M 1024 -r 5
test_gen_hex:
#Generating 10,000 keys. 0 to 1024 bytes (not including identifier overhead)
echo "Generating text input > db > text"
rm -f test_gen_1
./ydb_gen $(TEST_GEN_HEX_FLAGS) | $(BDB_LOAD) test_gen_1
$(BDB_DUMP) test_gen_1 > 1
./ydb_gen -Hf > 2
./ydb_gen -hf $(TEST_GEN_HEX_FLAGS) -d g -s h | tr "h" "\n" | sort -t g -k 1,1 | tr -d "\n" | tr "g" "\n" >> 2
./ydb_gen -Fh >> 2
diff -q 1 2
if ! diff -q 1 2; then echo Files different!; exit 1; fi
rm -f $@.db.temp
./ydb_gen $(TEST_GEN_HEX_FLAGS) | $(BDB_LOAD) $@.db.temp
$(BDB_DUMP) $@.db.temp > $@.load_dump.temp
./ydb_gen -Hf > $@.gen_sorted.temp
./ydb_gen -hf $(TEST_GEN_HEX_FLAGS) -d g -s h | tr "h" "\n" | sort -t g -k 1,1 | tr -d "\n" | tr "g" "\n" >> $@.gen_sorted.temp
./ydb_gen -Fh >> $@.gen_sorted.temp
if ! diff -q $@.load_dump.temp $@.gen_sorted.temp; then echo Files different!; exit 1; fi
rm $@.*.temp
#if diff -q <(echo "foo") <(echo "foo") > /dev/null; then echo yes; else echo no; fi
clean:
rm -rf *.so *.o $(UTILS)
rm -rf *.so *.o $(UTILS) *.temp
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