2
# Copyright (C) 2005-2006 MySQL AB
2
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
4
4
# This program is free software; you can redistribute it and/or modify
5
5
# it under the terms of the GNU General Public License as published by
6
6
# the Free Software Foundation; version 2 of the License.
170
170
if ( $opt_reorder && !$quick_collect)
172
172
# Reorder the test cases in an order that will make them faster to run
175
173
# Make a mapping of test name to a string that represents how that test
176
174
# should be sorted among the other tests. Put the most important criterion
177
175
# first, then a sub-criterion, then sub-sub-criterion, etc.
183
181
# Append the criteria for sorting, in order of importance.
185
183
push(@criteria, "ndb=" . ($tinfo->{'ndb_test'} ? "A" : "B"));
184
push(@criteria, $tinfo->{template_path});
186
185
# Group test with equal options together.
187
186
# Ending with "~" makes empty sort later than filled
188
187
my $opts= $tinfo->{'master_opt'} ? $tinfo->{'master_opt'} : [];
189
188
push(@criteria, join("!", sort @{$opts}) . "~");
189
# Add slave opts if any
190
if ($tinfo->{'slave_opt'})
192
push(@criteria, join("!", sort @{$tinfo->{'slave_opt'}}));
194
# This sorts tests with force-restart *before* identical tests
195
push(@criteria, $tinfo->{force_restart} ? "force-restart" : "no-restart");
191
$sort_criteria{$tinfo->{name}} = join(" ", @criteria);
197
$tinfo->{criteria}= join(" ", @criteria);
195
$sort_criteria{$a->{'name'}} . $a->{'name'} cmp
196
$sort_criteria{$b->{'name'}} . $b->{'name'}; } @$cases;
200
@$cases = sort {$a->{criteria} cmp $b->{criteria}; } @$cases;
198
202
# For debugging the sort-order
199
203
# foreach my $tinfo (@$cases)
201
# print("$sort_criteria{$tinfo->{'name'}} -> \t$tinfo->{'name'}\n");
205
# my $tname= $tinfo->{name} . ' ' . $tinfo->{combination};
206
# my $crit= $tinfo->{criteria};
207
# print("$tname\n\t$crit\n");
206
211
if (defined $print_testcases){
217
222
sub split_testname {
218
223
my ($test_name)= @_;
220
# Get rid of directory part and split name on .'s
221
my @parts= split(/\./, basename($test_name));
225
# If .test file name is used, get rid of directory part
226
$test_name= basename($test_name) if $test_name =~ /\.test$/;
228
# Now split name on .'s
229
my @parts= split(/\./, $test_name);
223
231
if (@parts == 1){
224
232
# Only testname given, ex: alias
269
$suitedir= my_find_dir($::basedir,
277
$suitedir= my_find_dir($suitedir,
272
280
# Look in storage engine specific suite dirs
273
"storage/*/mysql-test-suites"
281
"../storage/*/mysql-test-suites"
313
321
if ( open(DISABLED, "$testdir/disabled.def" ) )
323
# $^O on Windows considered not generic enough
324
my $plat= (IS_WINDOWS) ? 'windows' : $^O;
315
326
while ( <DISABLED> )
318
if ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ )
329
#diasble the test case if platform matches
334
/^\s*(\S+)\s*\@$plat.*:\s*(.*?)\s*$/ ;
341
/^\s*(\S+)\s*\@!.*:\s*(.*?)\s*$/ ;
346
elsif ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ )
320
348
$disabled{$1}= $2;
584
612
# Check that engine selected by
585
613
# --default-storage-engine=<engine> is supported
586
614
# =======================================================
587
my %builtin_engines = ('myisam' => 1, 'memory' => 1);
615
my %builtin_engines = ('myisam' => 1, 'memory' => 1, 'csv' => 1);
589
617
foreach my $opt ( @{$tinfo->{master_opt}} ) {
590
618
my $default_engine=
715
$value= mtr_match_prefix($opt, "--testcase-timeout=");
716
if ( defined $value ) {
717
# Overrides test case timeout for this test
718
$tinfo->{'case-timeout'}= $value;
687
722
# Ok, this was a real option, add it
688
723
push(@{$tinfo->{$opt_name}}, $opt);
903
938
# Ndb is not supported, skip it
904
939
$tinfo->{'skip'}= 1;
905
$tinfo->{'comment'}= "No ndbcluster support";
940
$tinfo->{'comment'}= "No ndbcluster support or ndb tests not enabled";
908
943
elsif ( $::opt_skip_ndbcluster )