diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2016-10-10 02:28:29 -0400 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2016-10-10 17:28:29 +1100 |
commit | f086055e714fe8b4ec169d63437d09c88f256741 (patch) | |
tree | 504c4edbd8a1454451946c6e2c14049f5084c599 /test/utility | |
parent | 20448f38c1d7dee4905263e6f8b7683e873892f6 (diff) | |
download | mongo-f086055e714fe8b4ec169d63437d09c88f256741.tar.gz |
WT-2956 utility tests -h option is always overridden by the default setup (#3085)
Diffstat (limited to 'test/utility')
-rw-r--r-- | test/utility/misc.c | 4 | ||||
-rw-r--r-- | test/utility/parse_opts.c | 18 | ||||
-rw-r--r-- | test/utility/test_util.h | 2 |
3 files changed, 10 insertions, 14 deletions
diff --git a/test/utility/misc.c b/test/utility/misc.c index 096bc752726..1491c9a6938 100644 --- a/test/utility/misc.c +++ b/test/utility/misc.c @@ -27,6 +27,8 @@ */ #include "test_util.h" +void (*custom_die)(void) = NULL; + /* * die -- * Report an error and quit. @@ -142,8 +144,6 @@ testutil_cleanup(TEST_OPTS *opts) if (!opts->preserve) testutil_clean_work_dir(opts->home); - free(opts->conn_config); - free(opts->table_config); free(opts->uri); free(opts->home); } diff --git a/test/utility/parse_opts.c b/test/utility/parse_opts.c index 08aeafa9617..74a1c021d5d 100644 --- a/test/utility/parse_opts.c +++ b/test/utility/parse_opts.c @@ -27,10 +27,6 @@ */ #include "test_util.h" -extern int __wt_opterr; /* if error message should be printed */ -extern int __wt_optind; /* index into parent argv vector */ -extern int __wt_optopt; /* character checked for validity */ -extern int __wt_optreset; /* reset getopt */ extern char *__wt_optarg; /* argument associated with option */ /* @@ -59,7 +55,7 @@ testutil_parse_opts(int argc, char * const *argv, TEST_OPTS *opts) opts->n_append_threads = (uint64_t)atoll(__wt_optarg); break; case 'h': /* Home directory */ - opts->home = __wt_optarg; + opts->home = dstrdup(__wt_optarg); break; case 'n': /* Number of records */ opts->nrecords = (uint64_t)atoll(__wt_optarg); @@ -116,12 +112,14 @@ testutil_parse_opts(int argc, char * const *argv, TEST_OPTS *opts) } /* - * Setup the home directory. It needs to be unique for every test - * or the auto make parallel tester gets upset. + * Setup the home directory if not explicitly specified. It needs to be + * unique for every test or the auto make parallel tester gets upset. */ - len = strlen("WT_TEST.") + strlen(opts->progname) + 10; - opts->home = dmalloc(len); - snprintf(opts->home, len, "WT_TEST.%s", opts->progname); + if (opts->home == NULL) { + len = strlen("WT_TEST.") + strlen(opts->progname) + 10; + opts->home = dmalloc(len); + snprintf(opts->home, len, "WT_TEST.%s", opts->progname); + } /* Setup the default URI string */ len = strlen("table:") + strlen(opts->progname) + 10; diff --git a/test/utility/test_util.h b/test/utility/test_util.h index 1047d1ca8a0..52f4291044d 100644 --- a/test/utility/test_util.h +++ b/test/utility/test_util.h @@ -68,10 +68,8 @@ typedef struct { * resources. */ WT_CONNECTION *conn; - char *conn_config; WT_SESSION *session; bool running; - char *table_config; char *uri; volatile uint64_t next_threadid; uint64_t max_inserted_id; |