~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/test-run.pl

  • Committer: Monty Taylor
  • Date: 2010-12-26 03:00:37 UTC
  • mto: This revision was merged to the branch mainline in revision 2038.
  • Revision ID: mordred@inaugust.com-20101226030037-2qcfxg5ryamekd56
Cleaned through ha0ha.

Show diffs side-by-side

added added

removed removed

Lines of Context:
148
148
 
149
149
our $opt_usage;
150
150
our $opt_suites;
151
 
our $opt_suites_default= "main"; # Default suites to run
 
151
our $opt_suites_default= "main,jp"; # Default suites to run
152
152
our $opt_script_debug= 0;  # Script debugging, enable with --script-debug
153
153
our $opt_verbose= 0;  # Verbose output, enable with --verbose
154
154
 
230
230
our $opt_slave_myport;
231
231
our $opt_memc_myport;
232
232
our $opt_pbms_myport;
233
 
our $opt_rabbitmq_myport;
234
233
our $opt_record;
235
234
my $opt_report_features;
236
235
our $opt_check_testcases;
374
373
  }
375
374
  else
376
375
  {
377
 
 
 
376
    # Figure out which tests we are going to run
378
377
    if (!$opt_suites)
379
378
    {
380
 
 
381
 
        $opt_suites= $opt_suites_default;
382
 
 
383
 
        my %extra_suites= ();
384
 
 
385
 
        foreach my $dir ( reverse splitdir($glob_basedir) )
386
 
        {
387
 
            my $extra_suite= $extra_suites{$dir};
388
 
            if (defined $extra_suite){
389
 
                dtr_report("Found extra suite: $extra_suite");
390
 
                $opt_suites= "$extra_suite,$opt_suites";
391
 
                last;
392
 
            }
393
 
        }
 
379
      $opt_suites= $opt_suites_default;
 
380
 
 
381
      # Check for any extra suites to enable based on the path name
 
382
      my %extra_suites= ();
 
383
 
 
384
      foreach my $dir ( reverse splitdir($glob_basedir) )
 
385
      {
 
386
        my $extra_suite= $extra_suites{$dir};
 
387
        if (defined $extra_suite){
 
388
          dtr_report("Found extra suite: $extra_suite");
 
389
          $opt_suites= "$extra_suite,$opt_suites";
 
390
          last;
 
391
        }
 
392
      }
394
393
    }
395
394
 
396
395
    my $tests= collect_test_cases($opt_suites);
509
508
             'slave_port=i'             => \$opt_slave_myport,
510
509
             'memc_port=i'              => \$opt_memc_myport,
511
510
             'pbms_port=i'              => \$opt_pbms_myport,
512
 
             'rabbitmq_port=i'              => \$opt_rabbitmq_myport,
513
511
             'dtr-build-thread=i'       => \$opt_dtr_build_thread,
514
512
 
515
513
             # Test case authoring
615
613
             'help|h'                   => \$opt_usage,
616
614
            ) or usage("Can't read options");
617
615
 
 
616
  usage("") if $opt_usage;
 
617
 
618
618
  usage("you cannot specify --gdb and --dbx both!") if 
619
619
        ($opt_gdb && $opt_dbx) ||
620
620
        ($opt_manual_gdb && $opt_manual_dbx);
661
661
  # distributions, TAR binary distributions and some other packages.
662
662
  $glob_basedir= dirname($glob_drizzle_test_dir);
663
663
 
664
 
  # Figure out which tests we are going to run
665
 
  my $suitedir= "$glob_drizzle_test_dir/suite";
666
 
  if ( -d $suitedir )
667
 
  {
668
 
      opendir(SUITE_DIR, $suitedir)
669
 
          or dtr_error("can't open directory \"$suitedir\": $!");
670
 
 
671
 
      while ( my $elem= readdir(SUITE_DIR) )
672
 
      {
673
 
          next if $elem eq ".";
674
 
          next if $elem eq "..";
675
 
          next if $elem eq "big"; # Eats up too much disk
676
 
          next if $elem eq "large_tests"; # Eats up too much disk
677
 
          next if $elem eq "stress"; # Currently fails
678
 
          next if $elem eq "broken"; # Old broken test, mainly unsupported featurs
679
 
 
680
 
          my $local_dir= "$suitedir/$elem";
681
 
 
682
 
          next unless -d $local_dir;
683
 
          next unless -d "$local_dir/t"; # We want to make sure it has tests
684
 
          next unless -d "$local_dir/r"; # Ditto, results
685
 
 
686
 
          $opt_suites_default.= ",$elem";
687
 
      }
688
 
      closedir(SUITE_DIR);
689
 
  }
690
 
 
691
 
  usage("") if $opt_usage;
692
 
 
693
664
  # In the RPM case, binaries and libraries are installed in the
694
665
  # default system locations, instead of having our own private base
695
666
  # directory. And we install "/usr/share/drizzle-test". Moving up one
1170
1141
  $opt_slave_myport=          gimme_a_good_port($opt_master_myport + 2);  # and 3 4
1171
1142
  $opt_memc_myport= gimme_a_good_port($opt_master_myport + 10);
1172
1143
  $opt_pbms_myport= gimme_a_good_port($opt_master_myport + 11);
1173
 
  $opt_rabbitmq_myport= gimme_a_good_port($opt_master_myport + 12);
1174
1144
 
1175
1145
  if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
1176
1146
  {
1500
1470
  $ENV{'SLAVE_MYPORT1'}=      $slave->[1]->{'port'};
1501
1471
  $ENV{'SLAVE_MYPORT2'}=      $slave->[2]->{'port'};
1502
1472
  $ENV{'MC_PORT'}=            $opt_memc_myport;
1503
 
  $ENV{'PBMS_PORT'}=          $opt_pbms_myport;
1504
 
  $ENV{'RABBITMQ_NODE_PORT'}= $opt_rabbitmq_myport;
1505
 
  $ENV{'DRIZZLE_TCP_PORT'}=   $drizzled_variables{'drizzle-protocol.port'};
 
1473
  $ENV{'PBMS_PORT'}=            $opt_pbms_myport;
 
1474
  $ENV{'DRIZZLE_TCP_PORT'}=     $drizzled_variables{'drizzle-protocol.port'};
1506
1475
 
1507
1476
  $ENV{'DTR_BUILD_THREAD'}=      $opt_dtr_build_thread;
1508
1477
 
1660
1629
    print "Using SLAVE_MYPORT2         = $ENV{SLAVE_MYPORT2}\n";
1661
1630
    print "Using MC_PORT               = $ENV{MC_PORT}\n";
1662
1631
    print "Using PBMS_PORT             = $ENV{PBMS_PORT}\n";
1663
 
    print "Using RABBITMQ_NODE_PORT    = $ENV{RABBITMQ_NODE_PORT}\n";
1664
1632
  }
1665
1633
 
1666
1634
  # Create an environment variable to make it possible
3327
3295
  {
3328
3296
    # write init file for drizzled
3329
3297
    dtr_tofile($dbx_init_file,
3330
 
               "stop in __1cIdrizzledLparse6Fpn0AHSession_pkcI_v_\n" .
 
3298
               "stop in __1cIdrizzledLmysql_parse6Fpn0AHSession_pkcI_v_\n" .
3331
3299
               "runargs $str\n" .
3332
3300
               "run\n" .
3333
3301
               "\n");
3398
3366
               "set args $str\n" .
3399
3367
               "$extra_gdb_init" .
3400
3368
               "set breakpoint pending on\n" .
3401
 
               "break drizzled::parse\n" .
 
3369
               "break drizzled::mysql_parse\n" .
3402
3370
               "commands 1\n" .
3403
3371
               "disable 1\n" .
3404
3372
               "end\n" .
3464
3432
    dtr_tofile($gdb_init_file,
3465
3433
               "file $$exe\n" .
3466
3434
               "set args $str\n" .
3467
 
               "break drizzled::parse\n" .
 
3435
               "break drizzled::mysql_parse\n" .
3468
3436
               "commands 1\n" .
3469
3437
               "disable 1\n" .
3470
3438
               "end");