Commit 61119e42 authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul Committed by Yoni Fogel

Merge changes for #2859 (delete dirs when tests complete). Fixes #2859. close[t:2859]

git-svn-id: file:///svn/toku/tokudb@22773 c7de825b-a66e-492c-adef-691d508d4ae1
parent 6054331d
......@@ -193,6 +193,7 @@ test_main (int argc, const char *argv[]) {
printf("Total time %9.6fs for %lld insertions = %8.0f/s\n", toku_tdiff(&t3, &t1), f*total_n_items, f*total_n_items/toku_tdiff(&t3, &t1));
fflush(stdout);
}
unlink(fname);
if (verbose>1) {
toku_malloc_report();
}
......
......@@ -408,6 +408,8 @@ int test_main (int argc, const char *argv[]) {
// run test
test_extractor(nrows, nrowsets, testdir);
r = system(unlink_all); CKERR(r);
return 0;
}
......
......@@ -539,15 +539,16 @@ int test_main (int argc, const char *argv[]) {
if (tend>=0 && tend<event_limit) event_limit=tend;
if (verbose) printf("event_limit=%d\n", event_limit);
for (int i = tstart+1; i <= event_limit; i++) {
reset_event_counts();
reset_my_malloc_counts();
event_count_trigger = i;
r = system(unlink_all); CKERR(r);
r = toku_os_mkdir(directory, 0755); CKERR(r);
if (verbose) printf("event=%d\n", i);
test(directory, TRUE);
}
for (int i = tstart+1; i <= event_limit; i++) {
reset_event_counts();
reset_my_malloc_counts();
event_count_trigger = i;
r = system(unlink_all); CKERR(r);
r = toku_os_mkdir(directory, 0755); CKERR(r);
if (verbose) printf("event=%d\n", i);
test(directory, TRUE);
}
r = system(unlink_all); CKERR(r);
}
return 0;
......
......@@ -239,6 +239,8 @@ int test_main (int argc, const char *argv[]) {
write_dbfile(template, n, output_name, TRUE, i);
}
r = system(unlink_all); CKERR(r);
return 0;
}
......
......@@ -227,6 +227,10 @@ int test_main (int argc, const char *argv[]) {
assert (olen>0 && olen<templen);
test_write_dbfile(template, nrows, output_name);
r = system(unlink_all);
CKERR(r);
return 0;
}
......
......@@ -378,6 +378,13 @@ int test_main (int argc, const char *argv[]) {
test_mergesort_row_array();
test_merge_files(template, output_name);
{
char deletecmd[templen];
int n = snprintf(deletecmd, templen, "rm -rf %s", directory);
assert(n>0 && n<templen);
system(deletecmd);
}
return 0;
}
......
......@@ -105,5 +105,6 @@ test_main (int argc __attribute__((__unused__)), const char *argv[] __attribute_
open_file();
writeit();
readit();
unlink(fname);
return 0;
}
......@@ -40,6 +40,9 @@ test_main (int argc __attribute__((__unused__)),
r = toku_logger_find_next_unused_log_file(dname,&lognum);
assert(r==0 && lognum==123456789012346LL);
r = system(rmrf);
CKERR(r);
return 0;
}
......@@ -22,5 +22,7 @@ test_main (int argc __attribute__((__unused__)),
assert(r == 0);
r = toku_logger_close(&logger);
assert(r == 0);
r = system(rmrf);
CKERR(r);
return 0;
}
......@@ -24,5 +24,7 @@ test_main (int argc __attribute__((__unused__)),
assert(r == 0);
r = toku_logger_close(&logger);
assert(r == 0);
r = system(rmrf);
CKERR(r);
return 0;
}
......@@ -40,5 +40,7 @@ test_main (int argc __attribute__((__unused__)),
assert(r==0);
assert(statbuf.st_size==12+5);
}
r = system(rmrf);
CKERR(r);
return 0;
}
......@@ -62,5 +62,7 @@ test_main (int argc __attribute__((__unused__)),
r = closedir(dir);
assert(r==0);
}
r = system(rmrf);
CKERR(r);
return 0;
}
......@@ -63,5 +63,7 @@ test_main (int argc __attribute__((__unused__)),
assert(r==0);
assert(statbuf.st_size<=LSIZE);
}
r = system(rmrf);
CKERR(r);
return 0;
}
......@@ -83,5 +83,8 @@ test_main (int argc, const char *argv[]) {
r = toku_logcursor_destroy(&lc);
assert(r == 0 && lc == NULL);
r = system(rmrf);
CKERR(r);
return 0;
}
......@@ -36,5 +36,8 @@ test_main (int argc, const char *argv[]) {
r = toku_logcursor_destroy(&lc);
assert(r == 0 && lc == NULL);
r = system(rmrf);
CKERR(r);
return 0;
}
......@@ -108,5 +108,8 @@ test_main (int argc, const char *argv[]) {
r = toku_logcursor_destroy(&lc);
assert(r == 0 && lc == NULL);
r = system(rmrf);
CKERR(r);
return 0;
}
......@@ -150,5 +150,9 @@ test_main (int argc, const char *argv[]) {
r = toku_logger_close(&logger);
}
r = system(rmrf);
CKERR(r);
return 0;
}
......@@ -114,5 +114,8 @@ test_main (int argc, const char *argv[]) {
r = toku_logcursor_destroy(&lc);
assert(r == 0 && lc == NULL);
r = system(rmrf);
CKERR(r);
return 0;
}
......@@ -97,5 +97,8 @@ test_main (int argc, const char *argv[]) {
r = toku_logcursor_destroy(&lc);
assert(r == 0 && lc == NULL);
r = system(rmrf);
CKERR(r);
return 0;
}
......@@ -61,6 +61,8 @@ run_test(void) {
trim += 1;
}
r = system("rm -rf " TESTDIR);
CKERR(r);
return 0;
}
......
......@@ -44,6 +44,9 @@ run_test(void) {
r = tokudb_recover(TESTDIR, TESTDIR, 0, 0, NULL, NULL, 0);
assert(r == 0);
r = system("rm -rf " TESTDIR);
CKERR(r);
return 0;
}
......
......@@ -28,6 +28,10 @@ run_test(void) {
// run recovery
r = tokudb_recover(TESTDIR, TESTDIR, 0, 0, NULL, NULL, 0);
assert(r == 0);
r = system("rm -rf " TESTDIR);
CKERR(r);
return 0;
}
......
......@@ -34,6 +34,10 @@ run_test(void) {
r = tokudb_recover(TESTDIR, TESTDIR, 0, 0, NULL, NULL, 0);
assert(r == 0);
r = system("rm -rf " TESTDIR);
CKERR(r);
return 0;
}
......
......@@ -39,6 +39,10 @@ run_test(void) {
NULL, NULL,
0);
assert(r == 0);
r = system("rm -rf " TESTDIR);
CKERR(r);
return 0;
}
......
......@@ -32,6 +32,9 @@ run_test(void) {
r = tokudb_recover(TESTDIR, TESTDIR, 0, 0, NULL, NULL, 0);
assert(r == DB_RUNRECOVERY);
r = system("rm -rf " TESTDIR);
CKERR(r);
return 0;
}
......
......@@ -37,6 +37,10 @@ run_test(void) {
// run recovery
r = tokudb_recover(TESTDIR, TESTDIR, 0, 0, NULL, NULL, 0);
assert(r == 0);
r = system("rm -rf " TESTDIR);
CKERR(r);
return 0;
}
......
......@@ -37,6 +37,10 @@ run_test(void) {
// run recovery
r = tokudb_recover(TESTDIR, TESTDIR, 0, 0, NULL, NULL, 0);
assert(r == 0);
r = system("rm -rf " TESTDIR);
CKERR(r);
return 0;
}
......
......@@ -67,6 +67,10 @@ run_test(void) {
// run recovery
r = tokudb_recover(TESTDIR, TESTDIR, 0, 0, NULL, NULL, 0);
assert(r != 0);
r = system("rm -rf " TESTDIR);
CKERR(r);
return 0;
}
......
......@@ -31,6 +31,10 @@ run_test(void) {
// run recovery
r = tokudb_recover("/junk", TESTDIR, 0, 0, NULL, NULL, 0);
assert(r != 0);
r = system("rm -rf " TESTDIR);
CKERR(r);
return 0;
}
......
......@@ -23,6 +23,10 @@ run_test(void) {
// run recovery
r = tokudb_recover(TESTDIR, TESTDIR, 0, 0, NULL, NULL, 0);
assert(r != 0);
r = system("rm -rf " TESTDIR);
CKERR(r);
return 0;
}
......
......@@ -17,6 +17,10 @@ run_test(void) {
// run recovery
r = tokudb_recover(NULL, NULL, 0, 0, NULL, NULL, 0);
assert(r != 0);
r = system("rm -rf " TESTDIR);
CKERR(r);
return 0;
}
......
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