Skip to content

Commit

Permalink
mtr_cases.pl:
Browse files Browse the repository at this point in the history
  Added support for the disabled.def file
  • Loading branch information
[email protected] committed Jul 7, 2005
1 parent fe21793 commit 922f2fa
Showing 1 changed file with 39 additions and 4 deletions.
43 changes: 39 additions & 4 deletions mysql-test/lib/mtr_cases.pl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use strict;

sub collect_test_cases ($);
sub collect_one_test_case ($$$$$);
sub collect_one_test_case ($$$$$$);

##############################################################################
#
Expand Down Expand Up @@ -46,18 +46,36 @@ ($)
{
mtr_error("Test case $tname ($testdir/$elem) is not found");
}
collect_one_test_case($testdir,$resdir,$tname,$elem,$cases);
collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,{});
}
closedir TESTDIR;
}
else
{
# ----------------------------------------------------------------------
# Skip some tests listed in disabled.def
# ----------------------------------------------------------------------
my %skiplist;
my $skipfile= "$testdir/disabled.def";
if ( open(SKIPFILE, $skipfile) )
{
while ( <SKIPFILE> )
{
chomp;
if ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ )
{
$skiplist{$1}= $2;
}
}
close SKIPFILE;
}

foreach my $elem ( sort readdir(TESTDIR) ) {
my $tname= mtr_match_extension($elem,"test");
next if ! defined $tname;
next if $::opt_do_test and ! defined mtr_match_prefix($elem,$::opt_do_test);

collect_one_test_case($testdir,$resdir,$tname,$elem,$cases);
collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%skiplist);
}
closedir TESTDIR;
}
Expand Down Expand Up @@ -95,12 +113,13 @@ ($)
##############################################################################


sub collect_one_test_case($$$$$) {
sub collect_one_test_case($$$$$$) {
my $testdir= shift;
my $resdir= shift;
my $tname= shift;
my $elem= shift;
my $cases= shift;
my $skiplist=shift;

my $path= "$testdir/$elem";

Expand Down Expand Up @@ -154,6 +173,14 @@ ($$$$$)
}
}

if ( defined mtr_match_prefix($tname,"federated") )
{
$tinfo->{'slave_num'}= 1; # Default, use one slave

# FIXME currently we always restart slaves
$tinfo->{'slave_restart'}= 1;
}

# FIXME what about embedded_server + ndbcluster, skip ?!

my $master_opt_file= "$testdir/$tname-master.opt";
Expand Down Expand Up @@ -264,6 +291,14 @@ ($$$$$)
}
}

# FIXME why this late?
if ( $skiplist->{$tname} )
{
$tinfo->{'skip'}= 1;
$tinfo->{'disable'}= 1; # Sub type of 'skip'
$tinfo->{'comment'}= $skiplist->{$tname} if $skiplist->{$tname};
}

if ( -f $disabled )
{
$tinfo->{'skip'}= 1;
Expand Down

0 comments on commit 922f2fa

Please sign in to comment.