~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/lib/mtr_cases.pl

  • Committer: Monty Taylor
  • Date: 2010-07-08 04:31:12 UTC
  • mfrom: (1644.1.6 build)
  • Revision ID: mordred@inaugust.com-20100708043112-3l45pzavenlr7xu4
Merged in master.opt plugin consolidation, VJ's work with mysql-protocol and
drizzle-protocol plugin options and a drizzletest segfault bugfix from
Stewart.

Show diffs side-by-side

added added

removed removed

Lines of Context:
578
578
    $tinfo->{'slave_num'}= 1;
579
579
  }
580
580
 
581
 
  my $master_opt_file= "$testdir/$tname-master.opt";
 
581
  my $global_master_opt_file= "$testdir/master.opt";
 
582
  my $test_master_opt_file= "$testdir/$tname-master.opt";
582
583
  my $slave_opt_file=  "$testdir/$tname-slave.opt";
583
584
  my $slave_mi_file=   "$testdir/$tname.slave-mi";
584
585
  my $master_sh=       "$testdir/$tname-master.sh";
599
600
    push(@{$tinfo->{'slave_opt'}}, $opt);
600
601
  }
601
602
 
602
 
  # Add master opts
603
 
  if ( -f $master_opt_file )
 
603
  foreach  my $master_opt_file ($global_master_opt_file, $test_master_opt_file)
604
604
  {
605
 
 
606
 
    my $master_opt= mtr_get_opts_from_file($master_opt_file);
607
 
 
608
 
    foreach my $opt ( @$master_opt )
 
605
    # Add master opts
 
606
    if ( -f $master_opt_file )
609
607
    {
610
 
      my $value;
611
 
 
612
 
      # The opt file is used both to send special options to the mysqld
613
 
      # as well as pass special test case specific options to this
614
 
      # script
615
 
 
616
 
      $value= mtr_match_prefix($opt, "--timezone=");
617
 
      if ( defined $value )
618
 
      {
619
 
        $tinfo->{'timezone'}= $value;
620
 
        next;
621
 
      }
622
 
 
623
 
      $value= mtr_match_prefix($opt, "--slave-num=");
624
 
      if ( defined $value )
625
 
      {
626
 
        $tinfo->{'slave_num'}= $value;
627
 
        next;
628
 
      }
629
 
 
630
 
      $value= mtr_match_prefix($opt, "--result-file=");
631
 
      if ( defined $value )
632
 
      {
633
 
        # Specifies the file mysqltest should compare
634
 
        # output against
635
 
        if ( -f "r/$::opt_engine/$value.result")
636
 
        {
637
 
          $tinfo->{'result_file'}= "r/$::opt_engine/$value.result";
638
 
        }
639
 
        else
640
 
        {
641
 
          $tinfo->{'result_file'}= "r/$value.result";
642
 
        }
643
 
 
644
 
        next;
645
 
      }
646
 
 
647
 
      # If we set default time zone, remove the one we have
648
 
      $value= mtr_match_prefix($opt, "--default-time-zone=");
649
 
      if ( defined $value )
650
 
      {
651
 
        # Set timezone for this test case to something different
652
 
        $tinfo->{'timezone'}= "GMT-8";
653
 
        # Fallthrough, add the --default-time-zone option
654
 
      }
655
 
 
656
 
      # The --restart option forces a restart even if no special
657
 
      # option is set. If the options are the same as next testcase
658
 
      # there is no need to restart after the testcase
659
 
      # has completed
660
 
      if ( $opt eq "--force-restart" )
661
 
      {
662
 
        $tinfo->{'force_restart'}= 1;
663
 
        next;
664
 
      }
665
 
 
666
 
      # Ok, this was a real option, add it
667
 
      push(@{$tinfo->{'master_opt'}}, $opt);
 
608
 
 
609
      my $master_opt= mtr_get_opts_from_file($master_opt_file);
 
610
 
 
611
      foreach my $opt ( @$master_opt )
 
612
      {
 
613
        my $value;
 
614
 
 
615
        # The opt file is used both to send special options to the mysqld
 
616
        # as well as pass special test case specific options to this
 
617
        # script
 
618
 
 
619
        $value= mtr_match_prefix($opt, "--timezone=");
 
620
        if ( defined $value )
 
621
        {
 
622
          $tinfo->{'timezone'}= $value;
 
623
          next;
 
624
        }
 
625
 
 
626
        $value= mtr_match_prefix($opt, "--slave-num=");
 
627
        if ( defined $value )
 
628
        {
 
629
          $tinfo->{'slave_num'}= $value;
 
630
          next;
 
631
        }
 
632
 
 
633
        $value= mtr_match_prefix($opt, "--result-file=");
 
634
        if ( defined $value )
 
635
        {
 
636
          # Specifies the file mysqltest should compare
 
637
          # output against
 
638
          if ( -f "r/$::opt_engine/$value.result")
 
639
          {
 
640
            $tinfo->{'result_file'}= "r/$::opt_engine/$value.result";
 
641
          }
 
642
          else
 
643
          {
 
644
            $tinfo->{'result_file'}= "r/$value.result";
 
645
          }
 
646
 
 
647
          next;
 
648
        }
 
649
 
 
650
        # If we set default time zone, remove the one we have
 
651
        $value= mtr_match_prefix($opt, "--default-time-zone=");
 
652
        if ( defined $value )
 
653
        {
 
654
          # Set timezone for this test case to something different
 
655
          $tinfo->{'timezone'}= "GMT-8";
 
656
          # Fallthrough, add the --default-time-zone option
 
657
        }
 
658
 
 
659
        # The --restart option forces a restart even if no special
 
660
        # option is set. If the options are the same as next testcase
 
661
        # there is no need to restart after the testcase
 
662
        # has completed
 
663
        if ( $opt eq "--force-restart" )
 
664
        {
 
665
          $tinfo->{'force_restart'}= 1;
 
666
          next;
 
667
        }
 
668
 
 
669
        # Ok, this was a real option, add it
 
670
        push(@{$tinfo->{'master_opt'}}, $opt);
 
671
      }
668
672
    }
669
673
  }
670
674