Below is the list of changes that have just been committed into a local
5.1 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-07-19 14:25:52+02:00, msvensson@neptunus.(none) +9 -0
Update 'abort_not_supported_test' to print a reason why the test was aborted
and use it in mysql-test-run.pl
Use standard defines as last argument to 'fn_format'
client/mysqltest.c@stripped, 2006-07-19 14:25:49+02:00, msvensson@neptunus.(none) +60 -22
Use proper defines for last argument to fn_format(they are defined in my_sys.h)
Make abort_not_supported_test print info about in what file the test was
aborted and a reason for it. The reason is a best guess, using the filename of
the .require file to format it.
mysql-test/include/not_ndb_default.inc@stripped, 2006-07-19 14:25:49+02:00, msvensson@neptunus.(none) +1 -1
Use a more descriptive name of the .require file
mysql-test/include/not_windows.inc@stripped, 2006-07-19 14:25:49+02:00, msvensson@neptunus.(none) +1 -1
Use a more descriptive name of the .require file
mysql-test/include/windows.inc@stripped, 2006-07-19 14:25:49+02:00, msvensson@neptunus.(none) +1 -1
Use a more descriptive name of the .require file
mysql-test/lib/mtr_io.pl@stripped, 2006-07-19 14:25:49+02:00, msvensson@neptunus.(none) +15 -1
Add new function 'mtr_lastlinefromfile' that will return only the last line of a file.
mysql-test/mysql-test-run.pl@stripped, 2006-07-19 14:25:49+02:00, msvensson@neptunus.(none) +5 -2
Get reason why mysqltest decided to abort testcase from mysqltest.log
mysql-test/r/not_ndb_default.require@stripped, 2006-07-19 14:18:28+02:00, msvensson@neptunus.(none) +0 -0
Rename: mysql-test/r/true.require -> mysql-test/r/not_ndb_default.require
mysql-test/r/not_windows.require@stripped, 2006-07-19 14:25:49+02:00, msvensson@neptunus.(none) +2 -0
New BitKeeper file ``mysql-test/r/not_windows.require''
mysql-test/r/not_windows.require@stripped, 2006-07-19 14:25:49+02:00, msvensson@neptunus.(none) +0 -0
mysql-test/r/windows.require@stripped, 2006-07-19 14:25:49+02:00, msvensson@neptunus.(none) +2 -0
New BitKeeper file ``mysql-test/r/windows.require''
mysql-test/r/windows.require@stripped, 2006-07-19 14:25:49+02:00, msvensson@neptunus.(none) +0 -0
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: msvensson
# Host: neptunus.(none)
# Root: /home/msvensson/mysql/my51-m-bug19535
--- 1.1/mysql-test/include/not_windows.inc 2006-07-19 14:26:02 +02:00
+++ 1.2/mysql-test/include/not_windows.inc 2006-07-19 14:26:02 +02:00
@@ -1,4 +1,4 @@
---require r/true.require
+--require r/not_windows.require
disable_query_log;
select convert(@@version_compile_os using latin1) NOT IN ("Win32","Win64","Windows") as "TRUE";
enable_query_log;
--- 1.1/mysql-test/include/windows.inc 2006-07-19 14:26:02 +02:00
+++ 1.2/mysql-test/include/windows.inc 2006-07-19 14:26:02 +02:00
@@ -1,4 +1,4 @@
---require r/true.require
+--require r/windows.require
disable_query_log;
select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") as "TRUE";
enable_query_log;
--- 1.1/mysql-test/include/not_ndb_default.inc 2006-07-19 14:26:02 +02:00
+++ 1.2/mysql-test/include/not_ndb_default.inc 2006-07-19 14:26:02 +02:00
@@ -1,4 +1,4 @@
---require r/true.require
+--require r/not_ndb_default.require
disable_query_log;
select convert(@@table_type using latin1) NOT IN ("ndbcluster","NDBCLUSTER") as "TRUE";
enable_query_log;
--- 1.3/mysql-test/lib/mtr_io.pl 2006-07-19 14:26:02 +02:00
+++ 1.4/mysql-test/lib/mtr_io.pl 2006-07-19 14:26:02 +02:00
@@ -11,6 +11,7 @@
sub mtr_fromfile ($);
sub mtr_tofile ($@);
sub mtr_tonewfile($@);
+sub mtr_lastlinefromfile($);
##############################################################################
#
@@ -113,6 +114,20 @@
return $text;
}
+sub mtr_lastlinefromfile ($) {
+ my $file= shift;
+ my $text;
+
+ open(FILE,"<",$file) or mtr_error("can't open file \"$file\": $!");
+ while (my $line= <FILE>)
+ {
+ $text= $line;
+ }
+ close FILE;
+ return $text;
+}
+
+
sub mtr_tofile ($@) {
my $file= shift;
@@ -128,6 +143,5 @@
print FILE join("", @_);
close FILE;
}
-
1;
--- 1.143/mysql-test/mysql-test-run.pl 2006-07-19 14:26:02 +02:00
+++ 1.144/mysql-test/mysql-test-run.pl 2006-07-19 14:26:02 +02:00
@@ -2330,8 +2330,11 @@
elsif ( $res == 62 )
{
# Testcase itself tell us to skip this one
- # FIXME get reason to skip from mysqltest
- $tinfo->{'comment'}= "Detected by testcase";
+
+ # Try to get reason from mysqltest.log
+ my $last_line= mtr_lastlinefromfile($path_timefile) if -f $path_timefile;
+ my $reason= mtr_match_prefix($last_line, "reason: ");
+ $tinfo->{'comment'}= defined $reason ? $reason : "Detected by testcase(reason unknown) ";
mtr_report_test_skipped($tinfo);
}
elsif ( $res == 63 )
--- New file ---
+++ mysql-test/r/not_windows.require 06/07/19 14:25:49
TRUE
1
--- New file ---
+++ mysql-test/r/windows.require 06/07/19 14:25:49
TRUE
1
--- 1.215/client/mysqltest.c 2006-07-19 14:26:02 +02:00
+++ 1.216/client/mysqltest.c 2006-07-19 14:26:02 +02:00
@@ -669,17 +669,43 @@
exit(1);
}
-/* Note that we will get some memory leaks when calling this! */
-static void abort_not_supported_test(const char *fname)
+static void abort_not_supported_test(const char *fmt, ...)
{
+ va_list args;
+ test_file* err_file= cur_file;
DBUG_ENTER("abort_not_supported_test");
+
+ /* Print include filestack */
fprintf(stderr, "The test '%s' is not supported by this installation\n",
- fname);
- if (!silent)
- printf("skipped\n");
+ file_stack->file_name);
+ fprintf(stderr, "Detected in file %s at line %d\n",
+ err_file->file_name, err_file->lineno);
+ while (err_file != file_stack)
+ {
+ err_file--;
+ fprintf(stderr, "included from %s at line %d\n",
+ err_file->file_name, err_file->lineno);
+ }
+
+ /* Print error message */
+ va_start(args, fmt);
+ if (fmt)
+ {
+ fprintf(stderr, "reason: ");
+ vfprintf(stderr, fmt, args);
+ fprintf(stderr, "\n");
+ fflush(stderr);
+ }
+ va_end(args);
+
+ /* Clean up and exit */
free_used_memory();
my_end(MY_CHECK_ERROR);
+
+ if (!silent)
+ printf("skipped\n");
+
exit(62);
}
@@ -691,13 +717,13 @@
DBUG_VOID_RETURN;
va_start(args, fmt);
-
fprintf(stderr, "mysqltest: ");
if (start_lineno != 0)
fprintf(stderr, "At line %u: ", start_lineno);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n");
va_end(args);
+
DBUG_VOID_RETURN;
}
@@ -723,10 +749,10 @@
if (!test_if_hard_path(fname))
{
strxmov(eval_file, opt_basedir, fname, NullS);
- fn_format(eval_file, eval_file,"","",4);
+ fn_format(eval_file, eval_file, "", "", MY_UNPACK_FILENAME);
}
else
- fn_format(eval_file, fname,"","",4);
+ fn_format(eval_file, fname, "", "", MY_UNPACK_FILENAME);
if (!my_stat(eval_file, &stat_info, MYF(MY_WME)))
die(NullS);
@@ -767,8 +793,9 @@
err:
if (res && eval_result)
- str_to_file(fn_format(eval_file, fname, "", ".eval",2), res_ptr,
- res_len);
+ str_to_file(fn_format(eval_file, fname, "", ".eval",
+ MY_REPLACE_EXT),
+ res_ptr, res_len);
my_free((gptr) tmp, MYF(0));
my_close(fd, MYF(MY_WME));
@@ -798,7 +825,11 @@
DBUG_ENTER("check_result");
if (res && require_option)
- abort_not_supported_test(fname);
+ {
+ char reason[FN_REFLEN];
+ fn_format(reason, fname, "", "", MY_REPLACE_EXT | MY_REPLACE_DIR);
+ abort_not_supported_test("Test requires: '%s'", reason);
+ }
switch (res) {
case RESULT_OK:
break; /* ok */
@@ -943,7 +974,7 @@
strxmov(buff, opt_basedir, name, NullS);
name=buff;
}
- fn_format(buff,name,"","",4);
+ fn_format(buff, name, "", "", MY_UNPACK_FILENAME);
if (cur_file == file_stack_end)
die("Source directives are nesting too deep");
@@ -1855,7 +1886,7 @@
q->last_argument= p;
charset_info= get_charset_by_csname(charset_name,MY_CS_PRIMARY,MYF(MY_WME));
if (!charset_info)
- abort_not_supported_test(charset_name);
+ abort_not_supported_test("Test requires charset '%s'", charset_name);
}
static uint get_errcodes(match_err *to,struct st_query *q)
@@ -2693,7 +2724,7 @@
}
#endif
if (con_sock && !free_con_sock && *con_sock && *con_sock != FN_LIBCHAR)
- con_sock=fn_format(buff, con_sock, TMPDIR, "",0);
+ con_sock=fn_format(buff, con_sock, TMPDIR, "", 0);
if (!con_db[0])
con_db= db;
/* Special database to allow one to connect without a database name */
@@ -3314,7 +3345,7 @@
strxmov(buff, opt_basedir, argument, NullS);
argument= buff;
}
- fn_format(buff, argument, "", "", 4);
+ fn_format(buff, argument, "", "", MY_UNPACK_FILENAME);
DBUG_ASSERT(cur_file == file_stack && cur_file->file == 0);
if (!(cur_file->file=
my_fopen(buff, O_RDONLY | FILE_BINARY, MYF(0))))
@@ -3331,7 +3362,7 @@
strxmov(buff, opt_basedir, argument, NullS);
argument= buff;
}
- fn_format(buff, argument, "", "", 4);
+ fn_format(buff, argument, "", "", MY_UNPACK_FILENAME);
timer_file= buff;
unlink(timer_file); /* Ignore error, may not exist */
break;
@@ -3425,7 +3456,7 @@
strxmov(buff, opt_basedir, fname, NullS);
fname= buff;
}
- fn_format(buff,fname,"","",4);
+ fn_format(buff, fname, "", "", MY_UNPACK_FILENAME);
if ((fd= my_open(buff, O_WRONLY | O_CREAT | O_TRUNC,
MYF(MY_WME | MY_FFNF))) < 0)
@@ -3439,19 +3470,24 @@
void dump_result_to_reject_file(const char *record_file, char *buf, int size)
{
char reject_file[FN_REFLEN];
- str_to_file(fn_format(reject_file, record_file,"",".reject",2), buf, size);
+ str_to_file(fn_format(reject_file, record_file, "", ".reject",
+ MY_REPLACE_EXT),
+ buf, size);
}
void dump_result_to_log_file(const char *record_file, char *buf, int size)
{
char log_file[FN_REFLEN];
- str_to_file(fn_format(log_file, record_file,"",".log",2), buf, size);
+ str_to_file(fn_format(log_file, record_file, "", ".log",
+ MY_REPLACE_EXT),
+ buf, size);
}
void dump_progress(const char *record_file)
{
char log_file[FN_REFLEN];
- str_to_file(fn_format(log_file, record_file,"",".progress",2),
+ str_to_file(fn_format(log_file, record_file, "", ".progress",
+ MY_REPLACE_EXT),
ds_progress.str, ds_progress.length);
}
@@ -4262,7 +4298,9 @@
if (err_errno == CR_SERVER_LOST ||
err_errno == CR_SERVER_GONE_ERROR)
die("require query '%s' failed: %d: %s", query, err_errno, err_error);
- abort_not_supported_test("failed_query");
+
+ /* Abort the run of this test, pass the failed query as reason */
+ abort_not_supported_test("Query '%s' failed, required functionality not supported", query);
}
if (q->abort_on_error)
@@ -5517,7 +5555,7 @@
strxmov(buff, opt_basedir, name, NullS);
name=buff;
}
- fn_format(buff,name,"","",4);
+ fn_format(buff, name, "", "", MY_UNPACK_FILENAME);
if (!embedded_server_arg_count)
{
| Thread |
|---|
| • bk commit into 5.1 tree (msvensson:1.2224) | msvensson | 19 Jul |