summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.blaudden>2007-04-10 14:45:13 +0200
committerunknown <msvensson@pilot.blaudden>2007-04-10 14:45:13 +0200
commit5565d32936deb276b68f8cfcb3c25e4421ac94bf (patch)
treec35fd99a254ab39f2a368bd52d15995d47411a62 /client
parent8163d5ec6eca4c11e2830f0240c54a7f2533b3b7 (diff)
downloadmariadb-git-5565d32936deb276b68f8cfcb3c25e4421ac94bf.tar.gz
Add --logdir option ot mysqltest
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c
index 02993398b45..3d7e082897f 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -92,6 +92,7 @@ enum {
static int record= 0, opt_sleep= -1;
static char *db= 0, *pass= 0;
const char *user= 0, *host= 0, *unix_sock= 0, *opt_basedir= "./";
+const char *opt_logdir= "";
const char *opt_include= 0, *opt_charsets_dir;
static int port= 0;
static int opt_max_connect_retries;
@@ -1009,7 +1010,7 @@ int dyn_string_cmp(DYNAMIC_STRING* ds, const char *fname)
die(NullS);
if (!eval_result && (uint) stat_info.st_size != ds->length)
{
- DBUG_PRINT("info",("Size differs: result size: %u file size: %llu",
+ DBUG_PRINT("info",("Size differs: result size: %u file size: %lu",
ds->length, stat_info.st_size));
DBUG_PRINT("info",("result: '%s'", ds->str));
DBUG_RETURN(RESULT_LENGTH_MISMATCH);
@@ -4244,6 +4245,8 @@ static struct my_option my_long_options[] =
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"include", 'i', "Include SQL before each test case.", (gptr*) &opt_include,
(gptr*) &opt_include, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"logdir", 0, "Directory for log files", (gptr*) &opt_logdir,
+ (gptr*) &opt_logdir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"mark-progress", OPT_MARK_PROGRESS,
"Write linenumber and elapsed time to <testname>.progress ",
(gptr*) &opt_mark_progress, (gptr*) &opt_mark_progress, 0,
@@ -4546,15 +4549,18 @@ void dump_result_to_reject_file(char *buf, int size)
void dump_result_to_log_file(char *buf, int size)
{
char log_file[FN_REFLEN];
- str_to_file(fn_format(log_file, result_file_name, "", ".log",
+ str_to_file(fn_format(log_file, result_file_name, opt_logdir, ".log",
+ *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT :
MY_REPLACE_EXT),
buf, size);
}
void dump_progress(void)
{
- char log_file[FN_REFLEN];
- str_to_file(fn_format(log_file, result_file_name, "", ".progress",
+ char progress_file[FN_REFLEN];
+ str_to_file(fn_format(progress_file, result_file_name,
+ opt_logdir, ".progress",
+ *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT :
MY_REPLACE_EXT),
ds_progress.str, ds_progress.length);
}
@@ -4563,7 +4569,8 @@ void dump_warning_messages(void)
{
char warn_file[FN_REFLEN];
- str_to_file(fn_format(warn_file, result_file_name, "", ".warnings",
+ str_to_file(fn_format(warn_file, result_file_name, opt_logdir, ".warnings",
+ *opt_logdir ? MY_REPLACE_DIR | MY_REPLACE_EXT :
MY_REPLACE_EXT),
ds_warning_messages.str, ds_warning_messages.length);
}