mirror of
https://github.com/MariaDB/server.git
synced 2025-11-30 05:23:50 +03:00
Move newbrt tests to subdir. Fixes #796.
git-svn-id: file:///svn/tokudb@3869 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
@@ -31,15 +31,15 @@ build: $(TARGETS)
|
|||||||
check: check-default check-xfast
|
check: check-default check-xfast
|
||||||
|
|
||||||
check-default: $(TARGET_TDB)
|
check-default: $(TARGET_TDB)
|
||||||
$(VALGRIND) ./$(TARGET_TDB)
|
$(VGRIND) ./$(TARGET_TDB)
|
||||||
|
|
||||||
check-x: $(TARGET_TDB)
|
check-x: $(TARGET_TDB)
|
||||||
$(VALGRIND) ./$(TARGET_TDB) -x
|
$(VGRIND) ./$(TARGET_TDB) -x
|
||||||
|
|
||||||
|
|
||||||
# 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 1
|
./$(TARGET_TDB) --noserial -x --valsize 1000 --cachesize 8000000 --xcount 1000 --periter 20000 --env xfast.dir 1
|
||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ int env_open_flags = DB_CREATE|DB_PRIVATE|DB_INIT_MPOOL;
|
|||||||
|
|
||||||
#define STRINGIFY2(s) #s
|
#define STRINGIFY2(s) #s
|
||||||
#define STRINGIFY(s) STRINGIFY2(s)
|
#define STRINGIFY(s) STRINGIFY2(s)
|
||||||
char *dbdir = "./bench." STRINGIFY(DIRSUF) "/"; /* DIRSUF is passed in as a -D argument to the compiler. */;
|
const char *dbdir = "./bench." STRINGIFY(DIRSUF) "/"; /* DIRSUF is passed in as a -D argument to the compiler. */;
|
||||||
char *dbfilename = "bench.db";
|
char *dbfilename = "bench.db";
|
||||||
char *dbname;
|
char *dbname;
|
||||||
|
|
||||||
@@ -99,6 +99,7 @@ void setup (void) {
|
|||||||
assert(r == 0);
|
assert(r == 0);
|
||||||
}
|
}
|
||||||
r = db->open(db, tid, dbfilename, NULL, DB_BTREE, DB_CREATE, 0644);
|
r = db->open(db, tid, dbfilename, NULL, DB_BTREE, DB_CREATE, 0644);
|
||||||
|
if (r!=0) fprintf(stderr, "errno=%d, %s\n", errno, strerror(errno));
|
||||||
assert(r == 0);
|
assert(r == 0);
|
||||||
if (do_transactions) {
|
if (do_transactions) {
|
||||||
r=tid->commit(tid, 0); assert(r==0);
|
r=tid->commit(tid, 0); assert(r==0);
|
||||||
@@ -231,6 +232,7 @@ int print_usage (const char *argv0) {
|
|||||||
fprintf(stderr, " --DB_INIT_TXN (1|0) turn on or turn off the DB_INIT_TXN env_open_flag\n");
|
fprintf(stderr, " --DB_INIT_TXN (1|0) turn on or turn off the DB_INIT_TXN env_open_flag\n");
|
||||||
fprintf(stderr, " --DB_INIT_LOG (1|0) turn on or turn off the DB_INIT_LOG env_open_flag\n");
|
fprintf(stderr, " --DB_INIT_LOG (1|0) turn on or turn off the DB_INIT_LOG env_open_flag\n");
|
||||||
fprintf(stderr, " --DB_INIT_LOCK (1|0) turn on or turn off the DB_INIT_LOCK env_open_flag\n");
|
fprintf(stderr, " --DB_INIT_LOCK (1|0) turn on or turn off the DB_INIT_LOCK env_open_flag\n");
|
||||||
|
fprintf(stderr, " --env DIR\n");
|
||||||
fprintf(stderr, " n_iterations how many iterations (default %lld)\n", default_n_items/DEFAULT_ITEMS_TO_INSERT_PER_ITERATION);
|
fprintf(stderr, " n_iterations how many iterations (default %lld)\n", default_n_items/DEFAULT_ITEMS_TO_INSERT_PER_ITERATION);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
@@ -247,73 +249,53 @@ int main (int argc, const char *argv[]) {
|
|||||||
if (strcmp(arg, "-x") == 0) {
|
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;
|
||||||
continue;
|
} else if (strcmp(arg, "--DB_INIT_TXN") == 0) {
|
||||||
}
|
|
||||||
if (strcmp(arg, "--DB_INIT_TXN") == 0) {
|
|
||||||
if (i+1 >= argc) return print_usage(argv[0]);
|
if (i+1 >= argc) return print_usage(argv[0]);
|
||||||
if (atoi(argv[++i]))
|
if (atoi(argv[++i]))
|
||||||
env_open_flags |= DB_INIT_TXN;
|
env_open_flags |= DB_INIT_TXN;
|
||||||
else
|
else
|
||||||
env_open_flags &= ~DB_INIT_TXN;
|
env_open_flags &= ~DB_INIT_TXN;
|
||||||
continue;
|
} else if (strcmp(arg, "--DB_INIT_LOG") == 0) {
|
||||||
}
|
|
||||||
if (strcmp(arg, "--DB_INIT_LOG") == 0) {
|
|
||||||
if (atoi(argv[++i]))
|
if (atoi(argv[++i]))
|
||||||
env_open_flags |= DB_INIT_LOG;
|
env_open_flags |= DB_INIT_LOG;
|
||||||
else
|
else
|
||||||
env_open_flags &= ~DB_INIT_LOG;
|
env_open_flags &= ~DB_INIT_LOG;
|
||||||
continue;
|
} else if (strcmp(arg, "--DB_INIT_LOCK") == 0) {
|
||||||
}
|
|
||||||
if (strcmp(arg, "--DB_INIT_LOCK") == 0) {
|
|
||||||
if (atoi(argv[++i]))
|
if (atoi(argv[++i]))
|
||||||
env_open_flags |= DB_INIT_LOCK;
|
env_open_flags |= DB_INIT_LOCK;
|
||||||
else
|
else
|
||||||
env_open_flags &= ~DB_INIT_LOCK;
|
env_open_flags &= ~DB_INIT_LOCK;
|
||||||
continue;
|
} else if (strcmp(arg, "--noserial") == 0) {
|
||||||
}
|
|
||||||
if (strcmp(arg, "--noserial") == 0) {
|
|
||||||
noserial=1;
|
noserial=1;
|
||||||
continue;
|
} else if (strcmp(arg, "--norandom") == 0) {
|
||||||
}
|
|
||||||
if (strcmp(arg, "--norandom") == 0) {
|
|
||||||
norandom=1;
|
norandom=1;
|
||||||
continue;
|
} else if (strcmp(arg, "--xcount") == 0) {
|
||||||
}
|
|
||||||
if (strcmp(arg, "--xcount") == 0) {
|
|
||||||
if (i+1 >= argc) return print_usage(argv[0]);
|
if (i+1 >= argc) return print_usage(argv[0]);
|
||||||
items_per_transaction = strtoll(argv[++i], 0, 10);
|
items_per_transaction = strtoll(argv[++i], 0, 10);
|
||||||
continue;
|
} else if (strcmp(arg, "--periter") == 0) {
|
||||||
}
|
|
||||||
if (strcmp(arg, "--periter") == 0) {
|
|
||||||
if (i+1 >= argc) return print_usage(argv[0]);
|
if (i+1 >= argc) return print_usage(argv[0]);
|
||||||
items_per_iteration = strtoll(argv[++i], 0, 10);
|
items_per_iteration = strtoll(argv[++i], 0, 10);
|
||||||
continue;
|
} else if (strcmp(arg, "--cachesize") == 0) {
|
||||||
}
|
|
||||||
if (strcmp(arg, "--cachesize") == 0) {
|
|
||||||
if (i+1 >= argc) return print_usage(argv[0]);
|
if (i+1 >= argc) return print_usage(argv[0]);
|
||||||
cachesize = strtoll(argv[++i], 0, 10);
|
cachesize = strtoll(argv[++i], 0, 10);
|
||||||
continue;
|
} else if (strcmp(arg, "--keysize") == 0) {
|
||||||
}
|
|
||||||
if (strcmp(arg, "--keysize") == 0) {
|
|
||||||
if (i+1 >= argc) return print_usage(argv[0]);
|
if (i+1 >= argc) return print_usage(argv[0]);
|
||||||
keysize = atoi(argv[++i]);
|
keysize = atoi(argv[++i]);
|
||||||
continue;
|
} else if (strcmp(arg, "--valsize") == 0) {
|
||||||
}
|
|
||||||
if (strcmp(arg, "--valsize") == 0) {
|
|
||||||
if (i+1 >= argc) return print_usage(argv[0]);
|
if (i+1 >= argc) return print_usage(argv[0]);
|
||||||
valsize = atoi(argv[++i]);
|
valsize = atoi(argv[++i]);
|
||||||
continue;
|
} else if (strcmp(arg, "--pagesize") == 0) {
|
||||||
}
|
|
||||||
if (strcmp(arg, "--pagesize") == 0) {
|
|
||||||
if (i+1 >= argc) return print_usage(argv[0]);
|
if (i+1 >= argc) return print_usage(argv[0]);
|
||||||
pagesize = atoi(argv[++i]);
|
pagesize = atoi(argv[++i]);
|
||||||
continue;
|
} else if (strcmp(arg, "--dupsort") == 0) {
|
||||||
}
|
|
||||||
if (strcmp(arg, "--dupsort") == 0) {
|
|
||||||
dupflags = DB_DUP + DB_DUPSORT;
|
dupflags = DB_DUP + DB_DUPSORT;
|
||||||
continue;
|
continue;
|
||||||
}
|
} else if (strcmp(arg, "--env") == 0) {
|
||||||
return print_usage(argv[0]);
|
if (i+1 >= argc) return print_usage(argv[0]);
|
||||||
|
dbdir = argv[++i];
|
||||||
|
} else {
|
||||||
|
return print_usage(argv[0]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (i<argc) {
|
if (i<argc) {
|
||||||
/* if it looks like a number */
|
/* if it looks like a number */
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ static void lookup (int i, int expect, int expectj) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_abort3 (void) {
|
void test_dupsort_del (void) {
|
||||||
int r;
|
int r;
|
||||||
system("rm -rf " ENVDIR);
|
system("rm -rf " ENVDIR);
|
||||||
r=mkdir(ENVDIR, 0777); assert(r==0);
|
r=mkdir(ENVDIR, 0777); assert(r==0);
|
||||||
@@ -99,6 +99,6 @@ void test_abort3 (void) {
|
|||||||
|
|
||||||
int main (int argc, const char *argv[]) {
|
int main (int argc, const char *argv[]) {
|
||||||
parse_args(argc, argv);
|
parse_args(argc, argv);
|
||||||
test_abort3();
|
test_dupsort_del();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user