Commit 177d0a11 authored by Yoni Fogel's avatar Yoni Fogel

addresses #1531 Make utils (check) works in windows

git-svn-id: file:///svn/toku/tokudb@11749 c7de825b-a66e-492c-adef-691d508d4ae1
parent 1f6bebe1
......@@ -123,6 +123,7 @@ test_gen: test_gen_hex
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
TDB_GEN=./tokudb_gen$(BINSUF)
......@@ -130,6 +131,15 @@ TDB_LOAD=./tokudb_load$(BINSUF)
TDB_DUMP=./tokudb_dump$(BINSUF)
TDB_DUMPBDB=./tokudb_dump.bdb$(BINSUF)
ifeq ($(OS_CHOICE),windows)
LINEEND = "\r\n"
TO_NATIVE = unix2dos --u2d
else
LINEEND = "\n"
TO_NATIVE = cat
endif
test_gen_hex:
#Generating $(TEST_GEN_HEX_NUMKEYS) keys. [$(TEST_GEN_HEX_LENGTHMIN),$(TEST_GEN_HEX_LENGTHLIMIT)) bytes + identifier overhead
@#echo "Generating text input > db > text"
......@@ -138,7 +148,7 @@ test_gen_hex:
$(BDB_LOAD) $@.db.temp < $@.gen.temp && \
$(BDB_DUMP) $@.db.temp > $@.load_dump.temp && \
$(TDB_GEN) -H -f > $@.gen_sorted.temp && \
export LC_ALL=C;$(TDB_GEN) -h -f $(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;$(TDB_GEN) -h -f $(TEST_GEN_HEX_FLAGS) -d "\t" -s "\n" | sort -k 1,1 | tr -d $(LINEEND) | tr "\t" "\n" | $(TO_NATIVE) >> $@.gen_sorted.temp && \
$(TDB_GEN) -F -h >> $@.gen_sorted.temp && \
$(DIFF) $@.load_dump.temp $@.gen_sorted.temp \
$(SUMMARIZE_CMD)
......
......@@ -33,7 +33,7 @@ static int get_delimiter(char* str);
char dbt_delimiter = '\n';
char sort_delimiter[2];
char sort_delimiter[3];
u_int32_t lengthmin = 0;
bool set_lengthmin = false;
u_int32_t lengthlimit = 0;
......@@ -171,6 +171,11 @@ static int test_main (int argc, char *argv[]) {
}
sort_delimiter[0] = (char)temp;
sort_delimiter[1] = '\0';
#if defined(TOKU_WINDOWS) && TOKU_WINDOWS
if (!strcmp(sort_delimiter, "\n")) {
strcpy(sort_delimiter, "\r\n");
}
#endif
break;
}
case ('V'): {
......
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