summaryrefslogtreecommitdiff
path: root/mysql-test/mysql-test-run.pl
diff options
context:
space:
mode:
authorunknown <tsmith@siva.hindu.god>2007-01-18 08:30:35 -0700
committerunknown <tsmith@siva.hindu.god>2007-01-18 08:30:35 -0700
commit61430c77a43d2b9bf8f5a928ca7977e96df0d1da (patch)
tree43ed4a13aa6f4077a05dacedc68e38e0ace6b8be /mysql-test/mysql-test-run.pl
parent8ca95b84281bd50685e7437fca3b06085f9cea56 (diff)
parent1a0bd37c4d5741e7297f318da07d77767a537ca7 (diff)
downloadmariadb-git-61430c77a43d2b9bf8f5a928ca7977e96df0d1da.tar.gz
Merge siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/51
into siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/maint/51 BUILD/check-cpu: Auto merged configure.in: Auto merged include/my_global.h: Auto merged mysql-test/mysql-test-run.pl: Auto merged mysql-test/r/sp.result: Auto merged mysql-test/r/type_enum.result: Auto merged mysql-test/r/udf.result: Auto merged mysql-test/r/view.result: Auto merged mysql-test/t/mysqladmin.test: Auto merged mysql-test/t/sp.test: Auto merged mysql-test/t/type_enum.test: Auto merged mysql-test/t/view.test: Auto merged mysys/my_read.c: Auto merged scripts/make_binary_distribution.sh: Auto merged server-tools/instance-manager/Makefile.am: Auto merged sql/event_queue.cc: Auto merged sql/field.h: Auto merged sql/item_sum.h: Auto merged sql/log_event.cc: Auto merged sql/mysqld.cc: Auto merged sql/share/errmsg.txt: Auto merged sql/sql_class.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_show.cc: Auto merged sql/table.cc: Auto merged storage/federated/ha_federated.cc: Auto merged server-tools/instance-manager/instance.cc: Use remote (global 5.1 version) sql/unireg.cc: Use remote (5.1 global version) mysql-test/t/trigger.test: Manual merge server-tools/instance-manager/guardian.cc: Manual merge
Diffstat (limited to 'mysql-test/mysql-test-run.pl')
-rwxr-xr-xmysql-test/mysql-test-run.pl77
1 files changed, 64 insertions, 13 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index b26c1eb6ca0..16e057a6bf3 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -160,6 +160,7 @@ our $exe_im;
our $exe_my_print_defaults;
our $exe_perror;
our $lib_udf_example;
+our $lib_example_plugin;
our $exe_libtool;
our $opt_bench= 0;
@@ -231,10 +232,12 @@ our $opt_ndbconnectstring_slave;
our $opt_record;
my $opt_report_features;
our $opt_check_testcases;
+our $opt_mark_progress;
our $opt_skip;
our $opt_skip_rpl;
our $max_slave_num= 0;
+our $max_master_num= 1;
our $use_innodb;
our $opt_skip_test;
our $opt_skip_im;
@@ -413,6 +416,15 @@ sub main () {
$max_slave_num= $test->{slave_num};
mtr_error("Too many slaves") if $max_slave_num > 3;
}
+
+ # Count max number of masters used by a test case
+ if ( $test->{master_num} > $max_master_num)
+ {
+ $max_master_num= $test->{master_num};
+ mtr_error("Too many masters") if $max_master_num > 2;
+ mtr_error("Too few masters") if $max_master_num < 1;
+ }
+
$use_innodb||= $test->{'innodb_test'};
}
@@ -536,6 +548,7 @@ sub command_line_setup () {
# Test case authoring
'record' => \$opt_record,
'check-testcases' => \$opt_check_testcases,
+ 'mark-progress' => \$opt_mark_progress,
# Extra options used when starting mysqld
'mysqld=s' => \@opt_extra_mysqld_opt,
@@ -1211,6 +1224,19 @@ sub command_line_setup () {
$path_ndb_testrun_log= "$opt_vardir/log/ndb_testrun.log";
$path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";
+
+ if ( $opt_valgrind and $opt_debug )
+ {
+ # When both --valgrind and --debug is selected, send
+ # all output to the trace file, making it possible to
+ # see the exact location where valgrind complains
+ foreach my $mysqld (@{$master}, @{$slave})
+ {
+ my $sidx= $mysqld->{idx} ? "$mysqld->{idx}" : "";
+ $mysqld->{path_myerr}=
+ "$opt_vardir/log/" . $mysqld->{type} . "$sidx.trace";
+ }
+ }
}
#
@@ -1259,9 +1285,10 @@ sub set_mtr_build_thread_ports($) {
sub datadir_list_setup () {
# Make a list of all data_dirs
- @data_dir_lst = (
- $master->[0]->{'path_myddir'},
- $master->[1]->{'path_myddir'});
+ for (my $idx= 0; $idx < $max_master_num; $idx++)
+ {
+ push(@data_dir_lst, $master->[$idx]->{'path_myddir'});
+ }
for (my $idx= 0; $idx < $max_slave_num; $idx++)
{
@@ -1499,6 +1526,11 @@ sub executable_setup () {
mtr_file_exists(vs_config_dirs('sql', 'udf_example.dll'),
"$glob_basedir/sql/.libs/udf_example.so",);
+ # Look for the ha_example library
+ $lib_example_plugin=
+ mtr_file_exists(vs_config_dirs('storage/example', 'ha_example.dll'),
+ "$glob_basedir/storage/example/.libs/ha_example.so",);
+
# Look for mysqltest executable
if ( $glob_use_embedded_server )
{
@@ -1655,6 +1687,14 @@ sub environment_setup () {
}
# --------------------------------------------------------------------------
+ # Add the path where mysqld will find ha_example.so
+ # --------------------------------------------------------------------------
+ if ( $lib_example_plugin )
+ {
+ push(@ld_library_paths, dirname($lib_example_plugin));
+ }
+
+ # --------------------------------------------------------------------------
# Valgrind need to be run with debug libraries otherwise it's almost
# impossible to add correct supressions, that means if "/usr/lib/debug"
# is available, it should be added to
@@ -1928,10 +1968,11 @@ sub environment_setup () {
$ENV{'UDF_EXAMPLE_LIB'}=
($lib_udf_example ? basename($lib_udf_example) : "");
- $ENV{'LD_LIBRARY_PATH'}=
- ($lib_udf_example ? dirname($lib_udf_example) : "") .
- ($ENV{'LD_LIBRARY_PATH'} ? ":$ENV{'LD_LIBRARY_PATH'}" : "");
-
+ # ----------------------------------------------------
+ # Add the path where mysqld will find ha_example.so
+ # ----------------------------------------------------
+ $ENV{'EXAMPLE_PLUGIN'}=
+ ($lib_example_plugin ? basename($lib_example_plugin) : "");
# ----------------------------------------------------
# We are nice and report a bit about our settings
@@ -2730,8 +2771,10 @@ sub mysql_install_db () {
install_db('master', $master->[0]->{'path_myddir'});
- # FIXME check if testcase really is using second master
- copy_install_db('master', $master->[1]->{'path_myddir'});
+ if ($max_master_num)
+ {
+ copy_install_db('master', $master->[1]->{'path_myddir'});
+ }
# Install the number of slave databses needed
for (my $idx= 0; $idx < $max_slave_num; $idx++)
@@ -3540,11 +3583,10 @@ sub mysqld_arguments ($$$$$) {
if ( $glob_use_embedded_server )
{
$prefix= "--server-arg=";
- } else {
- # We can't pass embedded server --no-defaults
- mtr_add_arg($args, "--no-defaults");
}
+ mtr_add_arg($args, "%s--no-defaults", $prefix);
+
mtr_add_arg($args, "%s--console", $prefix);
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
@@ -3623,6 +3665,9 @@ sub mysqld_arguments ($$$$$) {
# Turn on logging, will be sent to tables
mtr_add_arg($args, "%s--log=", $prefix);
}
+
+ mtr_add_arg($args, "%s--plugin_dir=%s", $prefix,
+ dirname($lib_example_plugin));
}
if ( $type eq 'slave' )
@@ -4273,7 +4318,8 @@ sub run_testcase_start_servers($) {
}
- if ( $clusters->[0]->{'pid'} and ! $master->[1]->{'pid'} )
+ if ( $clusters->[0]->{'pid'} and ! $master->[1]->{'pid'} and
+ $tinfo->{'master_num'} > 1 )
{
# Test needs cluster, start an extra mysqld connected to cluster
@@ -4485,6 +4531,10 @@ sub run_mysqltest ($) {
mtr_add_arg($args, "--character-sets-dir=%s", $path_charsetsdir);
mtr_add_arg($args, "--logdir=%s/log", $opt_vardir);
+ # Log line number and time for each line in .test file
+ mtr_add_arg($args, "--mark-progress")
+ if $opt_mark_progress;
+
if ($tinfo->{'component_id'} eq 'im')
{
mtr_add_arg($args, "--socket=%s", $instance_manager->{'path_sock'});
@@ -4940,6 +4990,7 @@ Options for test case authoring
record TESTNAME (Re)genereate the result file for TESTNAME
check-testcases Check testcases for sideeffects
+ mark-progress Log line number and elapsed time to <testname>.progress
Options that pass on options