From 127e4011853a59647c7cc8e8f0f5e662a9658a16 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 8 Oct 2006 17:05:17 +0200 Subject: [PATCH 1/3] Move list of mysqls src dirs into lib/mtr_gcov.pl as it's only used from there --- mysql-test/lib/mtr_gcov.pl | 18 +++++++++++++++++- mysql-test/mysql-test-run.pl | 16 ---------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/mysql-test/lib/mtr_gcov.pl b/mysql-test/lib/mtr_gcov.pl index 07aac1d2017..71d3d6a2a43 100644 --- a/mysql-test/lib/mtr_gcov.pl +++ b/mysql-test/lib/mtr_gcov.pl @@ -23,12 +23,28 @@ sub gcov_prepare () { -or -name \*.da | xargs rm`; } +# Used by gcov +our @mysqld_src_dirs= + ( + "strings", + "mysys", + "include", + "extra", + "regex", + "isam", + "merge", + "myisam", + "myisammrg", + "heap", + "sql", + ); + sub gcov_collect () { print "Collecting source coverage info...\n"; -f $::opt_gcov_msg and unlink($::opt_gcov_msg); -f $::opt_gcov_err and unlink($::opt_gcov_err); - foreach my $d ( @::mysqld_src_dirs ) + foreach my $d ( @mysqld_src_dirs ) { chdir("$::glob_basedir/$d"); foreach my $f ( (glob("*.h"), glob("*.cc"), glob("*.c")) ) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 7b9a55053f0..6bb069a11f5 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -87,22 +87,6 @@ require "lib/mtr_stress.pl"; $Devel::Trace::TRACE= 1; -# Used by gcov -our @mysqld_src_dirs= - ( - "strings", - "mysys", - "include", - "extra", - "regex", - "isam", - "merge", - "myisam", - "myisammrg", - "heap", - "sql", - ); - ############################################################################## # # Default settings From ddf7e2a5f01bbffc93b3b3440e12b154899d8cb0 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 8 Oct 2006 17:08:24 +0200 Subject: [PATCH 2/3] Do the check of special mysqld exe for master or slave after command line args have been parsed --- mysql-test/mysql-test-run.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 6bb069a11f5..40b0efd4971 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -487,9 +487,6 @@ sub initial_setup () { "$glob_basedir/sql/release/mysqld", "$glob_basedir/sql/debug/mysqld"); - $exe_master_mysqld= $exe_master_mysqld || $exe_mysqld; - $exe_slave_mysqld= $exe_slave_mysqld || $exe_mysqld; - # Use the mysqld found above to find out what features are available collect_mysqld_features(); @@ -922,6 +919,12 @@ sub command_line_setup () { } } + # -------------------------------------------------------------------------- + # Check if special exe was selected for master or slave + # -------------------------------------------------------------------------- + $exe_master_mysqld= $exe_master_mysqld || $exe_mysqld; + $exe_slave_mysqld= $exe_slave_mysqld || $exe_mysqld; + # -------------------------------------------------------------------------- # Check valgrind arguments # -------------------------------------------------------------------------- From eab94fd0ba53ed78c5104bfea7e48bb29c26126a Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 8 Oct 2006 17:48:01 +0200 Subject: [PATCH 3/3] Print names of testcases that failed check_testcase, this makes it easier to run the whole testcase to find wich testcases need to be checked more carefully and the just "copy and paste" the suspicious test case names to a new mysql-test-run.pl command. mysql-test/mysql-test-run.pl: Mark test cases that fails "check_testcase" Make run_check_testcase return value indicating if check failed mysql-test/include/check-testcase.test: New BitKeeper file ``mysql-test/include/check-testcase.test'' --- mysql-test/include/check-testcase.test | 49 ++++++++++++++++++++++++++ mysql-test/lib/mtr_report.pl | 26 +++++++++++++- mysql-test/mysql-test-run.pl | 11 +++++- 3 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 mysql-test/include/check-testcase.test diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test new file mode 100644 index 00000000000..d67e73470b0 --- /dev/null +++ b/mysql-test/include/check-testcase.test @@ -0,0 +1,49 @@ +# +# This test is executed twice for each test case if mysql-test-run is passed +# the flag --check-testcase. +# Before every testcase it's run with mysqltest in record mode and will +# thus produce an output file +# that can be compared to output from after the tescase. +# In that way it's possible to check that a testcase does not have +# any unwanted side affects. +# + +# +# Dump all global variables +# +show global variables; + +# +# Dump all databases +# +show databases; + +# +# Dump the "test" database, all it's tables and their data +# +--exec $MYSQL_DUMP --skip-comments test + +# +# Dump the "mysql" database and it's tables +# Select data separately to add "order by" +# +--exec $MYSQL_DUMP --skip-comments --no-data mysql +use mysql; +select * from columns_priv; +select * from db order by host, db, user; +select * from func; +select * from help_category; +select * from help_keyword; +select * from help_relation; +select * from help_relation; +select * from host; +select * from tables_priv; +select * from time_zone; +select * from time_zone_leap_second; +select * from time_zone_name; +select * from time_zone_transition; +select * from time_zone_transition_type; +select * from user; + + + diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 4708de92e07..ec1bed9671b 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -172,7 +172,7 @@ sub mtr_report_stats ($) { my $tot_failed= 0; my $tot_tests= 0; my $tot_restarts= 0; - my $found_problems= 0; # Some warnings are errors... + my $found_problems= 0; # Some warnings in the logfiles are errors... foreach my $tinfo (@$tests) { @@ -283,6 +283,7 @@ sub mtr_report_stats ($) { print "\n"; + # Print a list of testcases that failed if ( $tot_failed != 0 ) { my $test_mode= join(" ", @::glob_test_mode) || "default"; @@ -296,7 +297,30 @@ sub mtr_report_stats ($) { } } print "\n"; + } + + # Print a list of check_testcases that failed(if any) + if ( $::opt_check_testcases ) + { + my @check_testcases= (); + + foreach my $tinfo (@$tests) + { + if ( defined $tinfo->{'check_testcase_failed'} ) + { + push(@check_testcases, $tinfo->{'name'}); + } + } + + if ( @check_testcases ) + { + print "Check of testcase failed for: "; + print join(" ", @check_testcases); + print "\n\n"; + } + } + if ( $tot_failed != 0 || $found_problems) { mtr_error("there where failing test cases"); diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 40b0efd4971..c53ca49a7e9 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3932,6 +3932,10 @@ sub run_testcase_start_servers($) { # Before a testcase, run in record mode, save result file to var # After testcase, run and compare with the recorded file, they should be equal! # +# RETURN VALUE +# 0 OK +# 1 Check failed +# sub run_check_testcase ($$) { my $mode= shift; @@ -3976,6 +3980,7 @@ sub run_check_testcase ($$) { { mtr_error("Could not execute 'check-testcase' $mode testcase"); } + return $res; } @@ -4165,7 +4170,11 @@ sub run_mysqltest ($) { { if ($mysqld->{'pid'}) { - run_check_testcase("after", $mysqld); + if (run_check_testcase("after", $mysqld)) + { + # Check failed, mark the test case with that info + $tinfo->{'check_testcase_failed'}= 1; + } } } }