3042 Bjorn Munch 2011-03-08
Undo debug change to run_ctest in MTR
modified:
mysql-test/mysql-test-run.pl
3041 Bjorn Munch 2011-03-08
Bug#11831031: MTR SHOULD FIND TEST SUITES FROM FEATURE TREES OUTSIDE MYSQL-TEST
Adds plugin/<suite>/tests/mtr to list of places to find test suite
Also simply existing path under storage to storage/*/mtr/<suite>
modified:
mysql-test/lib/mtr_cases.pm
3040 Bjorn Munch 2011-03-07
Bug #11747313 31741: MYSQLTEST - DEPRECATE "SYSTEM" COMMAND
Removed do_system() in mysqltest.cc, replaced with error
Adapted mysqltest.test
Replaces some uses with new commands or exec
mysql-test/t/mysqlbinlog_raw_mode.test: had to build a .sh script
modified:
client/mysqltest.cc
mysql-test/r/mysqltest.result
mysql-test/t/mysqlbinlog_raw_mode.test
mysql-test/t/mysqltest.test
mysql-test/t/partition_mgm_err2.test
mysql-test/t/repair.test
mysql-test/t/show_check.test
3039 Bjorn Munch 2011-03-03
Bug #11766640 59789: HOOK THE INVOCATION OF UNIT TESTS IN MTR.
Follow-up fix for regex tests on Windows:
Rewrite test to run inline, rather than depending on external data file
Addendum: fix [alnum] test by replacing locale-dependent letter with '5'.
renamed:
regex/tests => regex/tests_include.h
modified:
regex/CMakeLists.txt
regex/main.c
regex/tests_include.h
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc 2011-02-23 04:53:07 +0000
+++ b/client/mysqltest.cc 2011-03-07 15:17:39 +0000
@@ -3049,83 +3049,6 @@ int do_modify_var(struct st_command *com
/*
- Wrapper for 'system' function
-
- NOTE
- If mysqltest is executed from cygwin shell, the command will be
- executed in the "windows command interpreter" cmd.exe and we prepend "sh"
- to make it be executed by cygwins "bash". Thus commands like "rm",
- "mkdir" as well as shellscripts can executed by "system" in Windows.
-
-*/
-
-int my_system(DYNAMIC_STRING* ds_cmd)
-{
-#if defined __WIN__ && defined USE_CYGWIN
- /* Dump the command into a sh script file and execute with system */
- str_to_file(tmp_sh_name, ds_cmd->str, ds_cmd->length);
- return system(tmp_sh_cmd);
-#else
- return system(ds_cmd->str);
-#endif
-}
-
-
-/*
- SYNOPSIS
- do_system
- command called command
-
- DESCRIPTION
- system <command>
-
- Eval the query to expand any $variables in the command.
- Execute the command with the "system" command.
-
-*/
-
-void do_system(struct st_command *command)
-{
- DYNAMIC_STRING ds_cmd;
- DBUG_ENTER("do_system");
-
- if (strlen(command->first_argument) == 0)
- die("Missing arguments to system, nothing to do!");
-
- init_dynamic_string(&ds_cmd, 0, command->query_len + 64, 256);
-
- /* Eval the system command, thus replacing all environment variables */
- do_eval(&ds_cmd, command->first_argument, command->end, !is_windows);
-
-#ifdef __WIN__
-#ifndef USE_CYGWIN
- /* Replace /dev/null with NUL */
- while(replace(&ds_cmd, "/dev/null", 9, "NUL", 3) == 0)
- ;
-#endif
-#endif
-
-
- DBUG_PRINT("info", ("running system command '%s' as '%s'",
- command->first_argument, ds_cmd.str));
- if (my_system(&ds_cmd))
- {
- if (command->abort_on_error)
- die("system command '%s' failed", command->first_argument);
-
- /* If ! abort_on_error, log message and continue */
- dynstr_append(&ds_res, "system command '");
- replace_dynstr_append(&ds_res, command->first_argument);
- dynstr_append(&ds_res, "' failed\n");
- }
-
- command->last_argument= command->end;
- dynstr_free(&ds_cmd);
- DBUG_VOID_RETURN;
-}
-
-
-/*
SYNOPSIS
set_wild_chars
set true to set * etc. as wild char, false to reset
@@ -8615,7 +8538,10 @@ int main(int argc, char **argv)
case Q_INC: do_modify_var(command, DO_INC); break;
case Q_DEC: do_modify_var(command, DO_DEC); break;
case Q_ECHO: do_echo(command); command_executed++; break;
- case Q_SYSTEM: do_system(command); break;
+ case Q_SYSTEM:
+ die("'system' command is deprecated, use exec or\n"\
+ " see the manual for portable commands to use");
+ break;
case Q_REMOVE_FILE: do_remove_file(command); break;
case Q_REMOVE_FILES_WILDCARD: do_remove_files_wildcard(command); break;
case Q_MKDIR: do_mkdir(command); break;
=== modified file 'mysql-test/lib/mtr_cases.pm'
--- a/mysql-test/lib/mtr_cases.pm 2011-01-18 11:09:49 +0000
+++ b/mysql-test/lib/mtr_cases.pm 2011-03-08 09:43:05 +0000
@@ -287,9 +287,11 @@ sub collect_one_suite($)
"mysql-test/suite",
"mysql-test",
# Look in storage engine specific suite dirs
- "storage/*/mysql-test-suites"
+ "storage/*/mtr",
+ # Look in plugin specific suite dir
+ "plugin/$suite/tests",
],
- [$suite]);
+ [$suite, "mtr"]);
}
mtr_verbose("suitedir: $suitedir");
}
=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl 2011-03-01 11:49:58 +0000
+++ b/mysql-test/mysql-test-run.pl 2011-03-08 09:48:07 +0000
@@ -5716,7 +5716,7 @@ sub run_ctest() {
# Also silently ignore if we don't have ctest and didn't insist
# Special override: also ignore in Pushbuild, some platforms may not have it
# Now, run ctest and collect output
- my $ctest_out= `ctest -V -R regex* $ctest_vs 2>&1`;
+ my $ctest_out= `ctest $ctest_vs 2>&1`;
if ($? == $no_ctest && $opt_ctest == -1 && ! defined $ENV{PB2WORKDIR}) {
chdir($olddir);
return;
=== modified file 'mysql-test/r/mysqltest.result'
--- a/mysql-test/r/mysqltest.result 2011-01-12 10:22:11 +0000
+++ b/mysql-test/r/mysqltest.result 2011-03-07 15:17:39 +0000
@@ -412,9 +412,8 @@ mysqltest: At line 1: Cannot perform inc
mysqltest: At line 1: End of line junk detected: "1000"
mysqltest: At line 1: Cannot perform inc/dec on a non-numeric value
mysqltest: At line 1: Cannot perform inc/dec on a non-numeric value
-mysqltest: At line 1: Missing arguments to system, nothing to do!
-mysqltest: At line 1: Missing arguments to system, nothing to do!
-system command 'NonExistsinfComamdn 2> /dev/null' failed
+mysqltest: At line 1: 'system' command is deprecated, use exec or
+ see the manual for portable commands to use
test
test2
test3
=== modified file 'mysql-test/t/mysqlbinlog_raw_mode.test'
--- a/mysql-test/t/mysqlbinlog_raw_mode.test 2010-05-21 21:48:20 +0000
+++ b/mysql-test/t/mysqlbinlog_raw_mode.test 2011-03-07 15:17:39 +0000
@@ -7,8 +7,13 @@
# If exit code is good or bad then entry in raw_mode_exit table will be created
# Anything above exit code 1 is bad. We wait for this
CREATE TABLE raw_mode_exit (exit_code INT);
---system `$MYSQL_BINLOG --raw --read-from-remote-server --stop-never --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --result-file=$MYSQLTEST_VARDIR/tmp/ master-bin.000001 ; [ \$? -le 1 ]` && $MYSQL -e "use test; INSERT INTO raw_mode_exit VALUES (1);" &
-
+# Now jump some loops to have mysqlbinlog executed in the background
+--write_file $MYSQL_TMP_DIR/mbl.sh
+#!/bin/sh
+(`$MYSQL_BINLOG --raw --read-from-remote-server --stop-never --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --result-file=$MYSQLTEST_VARDIR/tmp/ master-bin.000001 ; [ $? -le 1 ]` && $MYSQL -e "use test; INSERT INTO raw_mode_exit VALUES (1);") < /dev/null > /dev/null 2>&1 &
+EOF
+--chmod 0755 $MYSQL_TMP_DIR/mbl.sh
+--exec $MYSQL_TMP_DIR/mbl.sh
let $wait_condition= SELECT id from information_schema.processlist where processlist.command like '%Binlog%' and state like '%Master has sent%';
--source include/wait_condition.inc
--diff_files $MYSQLTEST_VARDIR/tmp/master-bin.000001 $MYSQLD_DATADIR/master-bin.000001
@@ -24,5 +29,6 @@ DROP TABLE raw_mode_exit;
--remove_file $MYSQLTEST_VARDIR/tmp/master-bin.000001
--remove_file $MYSQLTEST_VARDIR/tmp/master-bin.000002
--remove_file $MYSQLTEST_VARDIR/tmp/master-bin.000003
+--remove_file $MYSQL_TMP_DIR/mbl.sh
--echo End of tests
=== modified file 'mysql-test/t/mysqltest.test'
--- a/mysql-test/t/mysqltest.test 2011-01-12 10:22:11 +0000
+++ b/mysql-test/t/mysqltest.test 2011-03-07 15:17:39 +0000
@@ -1072,22 +1072,11 @@ echo $d;
# ----------------------------------------------------------------------------
-# Test system
+# Test system (which is now deprecated)
# ----------------------------------------------------------------------------
-#system ls > /dev/null;
-system echo "hej" > /dev/null;
-#--system ls > /dev/null
---system echo "hej" > /dev/null;
--error 1
---exec echo "system;" | $MYSQL_TEST 2>&1
---error 1
---exec echo "system $NONEXISTSINFVAREABLI;" | $MYSQL_TEST 2>&1
-
---disable_abort_on_error
-system NonExistsinfComamdn 2> /dev/null;
---enable_abort_on_error
-
+--exec echo "system something;" | $MYSQL_TEST 2>&1
# ----------------------------------------------------------------------------
# Test delimiter
=== modified file 'mysql-test/t/partition_mgm_err2.test'
--- a/mysql-test/t/partition_mgm_err2.test 2007-04-25 18:21:55 +0000
+++ b/mysql-test/t/partition_mgm_err2.test 2011-03-07 15:17:39 +0000
@@ -11,8 +11,9 @@
#
# BUG: 14354 Partitions: data directory clause fails
#
---system rm -rf $MYSQLTEST_VARDIR/tmp/bug14354
---system mkdir $MYSQLTEST_VARDIR/tmp/bug14354
+--error 0,1
+--remove_files_wildcard $MYSQLTEST_VARDIR/tmp/bug14354
+--mkdir $MYSQLTEST_VARDIR/tmp/bug14354
disable_query_log;
eval CREATE TABLE t1 (id int) PARTITION BY RANGE(id) (
PARTITION p1 VALUES LESS THAN (20) ENGINE=myisam
@@ -20,7 +21,8 @@ DATA DIRECTORY="$MYSQLTEST_VARDIR/tmp/bu
INDEX DIRECTORY="$MYSQLTEST_VARDIR/tmp/bug14354");
enable_query_log;
INSERT INTO t1 VALUES (15);
---system test -f $MYSQLTEST_VARDIR/tmp/bug14354/t1#P#p1.MYD
---system test -f $MYSQLTEST_VARDIR/tmp/bug14354/t1#P#p1.MYI
+--file_exists $MYSQLTEST_VARDIR/tmp/bug14354/t1#P#p1.MYD
+--file_exists $MYSQLTEST_VARDIR/tmp/bug14354/t1#P#p1.MYI
DROP TABLE t1;
---system rm -rf $MYSQLTEST_VARDIR/tmp/bug14354
+--remove_files_wildcard $MYSQLTEST_VARDIR/tmp/bug14354
+--rmdir $MYSQLTEST_VARDIR/tmp/bug14354
=== modified file 'mysql-test/t/repair.test'
--- a/mysql-test/t/repair.test 2010-02-03 05:32:38 +0000
+++ b/mysql-test/t/repair.test 2011-03-07 15:17:39 +0000
@@ -30,7 +30,7 @@ repair table t1 use_frm;
create table t1 engine=myisam SELECT 1,"table 1";
flush tables;
let $MYSQLD_DATADIR= `select @@datadir`;
-system echo 1 > $MYSQLD_DATADIR/test/t1.MYI ;
+exec echo 1 > $MYSQLD_DATADIR/test/t1.MYI ;
repair table t1;
repair table t1 use_frm;
drop table t1;
=== modified file 'mysql-test/t/show_check.test'
--- a/mysql-test/t/show_check.test 2011-01-18 13:09:35 +0000
+++ b/mysql-test/t/show_check.test 2011-03-07 15:17:39 +0000
@@ -442,7 +442,7 @@ flush tables;
# Create a junk frm file on disk
let $MYSQLD_DATADIR= `select @@datadir`;
-system echo "this is a junk file for test" >> $MYSQLD_DATADIR/test/t1.frm ;
+exec echo "this is a junk file for test" >> $MYSQLD_DATADIR/test/t1.frm ;
--replace_column 6 # 7 # 8 # 9 #
SHOW TABLE STATUS like 't1';
--error ER_NOT_FORM_FILE
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk-mtr branch (bjorn.munch:3039 to 3042) | Bjorn Munch | 8 Mar |