1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00
This commit is contained in:
Georgi Kodinov
2010-12-17 15:10:40 +02:00
271 changed files with 9221 additions and 1826 deletions

View File

@ -191,6 +191,8 @@ my $opt_cursor_protocol;
my $opt_view_protocol;
our $opt_debug;
my $debug_d= "d";
my $opt_debug_common;
our @opt_cases; # The test cases names in argv
our $opt_embedded_server;
@ -607,7 +609,10 @@ sub run_test_server ($$$) {
if ( !$opt_force ) {
# Test has failed, force is off
push(@$completed, $result);
return $completed;
return $completed unless $result->{'dont_kill_server'};
# Prevent kill of server, to get valgrind report
print $sock "BYE\n";
next;
}
elsif ($opt_max_test_fail > 0 and
$num_failed_test >= $opt_max_test_fail) {
@ -854,15 +859,16 @@ sub run_worker ($) {
mtr_report("Server said BYE");
stop_all_servers($opt_shutdown_timeout);
mark_time_used('restart');
my $valgrind_reports= 0;
if ($opt_valgrind_mysqld) {
valgrind_exit_reports();
$valgrind_reports= valgrind_exit_reports();
}
if ( $opt_gprof ) {
gprof_collect (find_mysqld($basedir), keys %gprof_dirs);
}
mark_time_used('init');
print_times_used($server, $thread_num);
exit(0);
exit($valgrind_reports);
}
else {
mtr_error("Could not understand server, '$line'");
@ -907,7 +913,7 @@ sub command_line_setup {
my $opt_list_options;
# Read the command line options
# Note: Keep list, and the order, in sync with usage at end of this file
# Note: Keep list in sync with usage at end of this file
Getopt::Long::Configure("pass_through");
my %options=(
# Control what engine/variation to run
@ -943,6 +949,7 @@ sub command_line_setup {
'combination=s' => \@opt_combinations,
'skip-combinations' => \&collect_option,
'experimental=s' => \@opt_experimentals,
# skip-im is deprecated and silently ignored
'skip-im' => \&ignore_option,
# Specify ports
@ -962,6 +969,7 @@ sub command_line_setup {
# Debugging
'debug' => \$opt_debug,
'debug-common' => \$opt_debug_common,
'gdb' => \$opt_gdb,
'client-gdb' => \$opt_client_gdb,
'manual-gdb' => \$opt_manual_gdb,
@ -1038,7 +1046,8 @@ sub command_line_setup {
'report-times' => \$opt_report_times,
'help|h' => \$opt_usage,
'list-options' => \$opt_list_options,
# list-options is internal, not listed in help
'list-options' => \$opt_list_options,
'skip-test-list=s' => \@opt_skip_test_list
);
@ -1551,6 +1560,18 @@ sub command_line_setup {
join(" ", @valgrind_args), "\"");
}
if ($opt_debug_common)
{
$opt_debug= 1;
$debug_d= "d,query,info,error,enter,exit";
}
if ($opt_debug && $opt_debug ne "1")
{
$debug_d= "d,$opt_debug";
$debug_d= "d,query,info,error,enter,exit" if $opt_debug eq "std";
}
mtr_report("Checking supported features...");
check_ndbcluster_support(\%mysqld_variables);
@ -1848,7 +1869,7 @@ sub client_debug_arg($$) {
if ( $opt_debug ) {
mtr_add_arg($args,
"--debug=d:t:A,%s/log/%s.trace",
"--debug=$debug_d:t:A,%s/log/%s.trace",
$path_vardir_trace, $client_name)
}
}
@ -3029,13 +3050,19 @@ sub mysql_install_db {
if ( $opt_debug )
{
mtr_add_arg($args, "--debug=d:t:i:A,%s/log/bootstrap.trace",
mtr_add_arg($args, "--debug=$debug_d:t:i:A,%s/log/bootstrap.trace",
$path_vardir_trace);
}
mtr_add_arg($args, "--lc-messages-dir=%s", $install_lang);
mtr_add_arg($args, "--character-sets-dir=%s", $install_chsdir);
# On some old linux kernels, aio on tmpfs is not supported
# Remove this if/when Bug #58421 fixes this in the server
if ($^O eq "linux" && $opt_mem) {
mtr_add_arg($args, "--loose-skip-innodb-use-native-aio");
}
# InnoDB arguments that affect file location and sizes may
# need to be given to the bootstrap process as well as the
# server process.
@ -4396,7 +4423,12 @@ sub after_failure ($) {
sub report_failure_and_restart ($) {
my $tinfo= shift;
stop_all_servers();
if ($opt_valgrind_mysqld && ($tinfo->{'warnings'} || $tinfo->{'timeout'})) {
# In these cases we may want valgrind report from normal termination
$tinfo->{'dont_kill_server'}= 1;
}
# Shotdown properly if not to be killed (for valgrind)
stop_all_servers($tinfo->{'dont_kill_server'} ? $opt_shutdown_timeout : 0);
$tinfo->{'result'}= 'MTR_RES_FAILED';
@ -4522,6 +4554,13 @@ sub mysqld_arguments ($$$) {
}
}
# On some old linux kernels, aio on tmpfs is not supported
# Remove this if/when Bug #58421 fixes this in the server
if ($^O eq "linux" && $opt_mem)
{
mtr_add_arg($args, "--loose-skip-innodb-use-native-aio");
}
if ( $mysql_version_id >= 50106 && !$opt_user_args)
{
# Turn on logging to file
@ -4614,7 +4653,7 @@ sub mysqld_start ($$) {
if ( $opt_debug )
{
mtr_add_arg($args, "--debug=d:t:i:A,%s/log/%s.trace",
mtr_add_arg($args, "--debug=$debug_d:t:i:A,%s/log/%s.trace",
$path_vardir_trace, $mysqld->name());
}
@ -5536,6 +5575,8 @@ sub valgrind_arguments {
#
sub valgrind_exit_reports() {
my $found_err= 0;
foreach my $log_file (keys %mysqld_logs)
{
my @culprits= ();
@ -5571,7 +5612,7 @@ sub valgrind_exit_reports() {
next;
}
# This line marks the start of a valgrind report
$found_report= 1 if $line =~ /ERROR SUMMARY:/;
$found_report= 1 if $line =~ /^==\d+== .* SUMMARY:/;
if ($found_report) {
$line=~ s/^==\d+== //;
@ -5588,8 +5629,11 @@ sub valgrind_exit_reports() {
mtr_print ("Valgrind report from $log_file after tests:\n", @culprits);
mtr_print_line();
print ("$valgrind_rep\n");
$found_err= 1;
}
}
return $found_err;
}
#
@ -5623,7 +5667,7 @@ Options to control what engine/variation to run
defaults-file=<config template> Use fixed config template for all
tests
defaults_extra_file=<config template> Extra config template to add to
defaults-extra-file=<config template> Extra config template to add to
all generated configs
combination=<opt> Use at least twice to run tests with specified
options to mysqld
@ -5711,6 +5755,8 @@ Options for debugging the product
client-gdb Start mysqltest client in gdb
ddd Start mysqld in ddd
debug Dump trace output for all servers and client programs
debug-common Same as debug, but sets 'd' debug flags to
"query,info,error,enter,exit"
debugger=NAME Start mysqld in the selected debugger
gdb Start the mysqld(s) in gdb
manual-debug Let user manually start mysqld in debugger, before
@ -5719,7 +5765,7 @@ Options for debugging the product
test(s)
manual-ddd Let user manually start mysqld in ddd, before running
test(s)
strace-client=[path] Create strace output for mysqltest client, optionally
strace-client[=path] Create strace output for mysqltest client, optionally
specifying name and path to the trace program to use.
Example: $0 --strace-client=ktrace
max-save-core Limit the number of core files saved (to avoid filling
@ -5752,7 +5798,7 @@ Options for valgrind
Misc options
user=USER User for connecting to mysqld(default: $opt_user)
comment=STR Write STR to the output
notimer Don't show test case execution time
timer Show test case execution time.
verbose More verbose output(use multiple times for even more)
verbose-restart Write when and why servers are restarted
start Only initialize and start the servers, using the
@ -5792,6 +5838,7 @@ Misc options
actions. Disable facility with NUM=0.
gcov Collect coverage information after the test.
The result is a gcov file per source and header file.
gprof Collect profiling information using gprof.
experimental=<file> Refer to list of tests considered experimental;
failures will be marked exp-fail instead of fail.
report-features First run a "test" that reports mysql features
@ -5804,6 +5851,11 @@ Misc options
engine to InnoDB.
report-times Report how much time has been spent on different
phases of test execution.
Some options that control enabling a feature for normal test runs,
can be turned off by prepending 'no' to the option, e.g. --notimer.
This applies to reorder, timer, check-testcases and warnings.
HERE
exit(1);