~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/test-run.pl

  • Committer: Brian Aker
  • Date: 2010-12-17 00:08:06 UTC
  • mfrom: (2002.1.4 clean)
  • Revision ID: brian@tangent.org-20101217000806-fa6kmggjnhsl4q85
Rollup for field encapsulation, monty fix for bzrignore, and Andrew bug
fixes.

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
 
156
156
 
157
157
our $exe_master_drizzled;
158
158
our $exe_drizzle;
159
 
our $exe_drizzleadmin;
160
159
our $exe_drizzle_client_test;
161
160
our $exe_bug25714;
162
161
our $exe_drizzled;
230
229
our $opt_slave_myport;
231
230
our $opt_memc_myport;
232
231
our $opt_pbms_myport;
233
 
our $opt_rabbitmq_myport;
234
232
our $opt_record;
235
233
my $opt_report_features;
236
234
our $opt_check_testcases;
374
372
  }
375
373
  else
376
374
  {
377
 
 
 
375
    # Figure out which tests we are going to run
378
376
    if (!$opt_suites)
379
377
    {
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
 
        }
 
378
      $opt_suites= $opt_suites_default;
 
379
 
 
380
      # Check for any extra suites to enable based on the path name
 
381
      my %extra_suites= ();
 
382
 
 
383
      foreach my $dir ( reverse splitdir($glob_basedir) )
 
384
      {
 
385
        my $extra_suite= $extra_suites{$dir};
 
386
        if (defined $extra_suite){
 
387
          dtr_report("Found extra suite: $extra_suite");
 
388
          $opt_suites= "$extra_suite,$opt_suites";
 
389
          last;
 
390
        }
 
391
      }
394
392
    }
395
393
 
396
394
    my $tests= collect_test_cases($opt_suites);
509
507
             'slave_port=i'             => \$opt_slave_myport,
510
508
             'memc_port=i'              => \$opt_memc_myport,
511
509
             'pbms_port=i'              => \$opt_pbms_myport,
512
 
             'rabbitmq_port=i'              => \$opt_rabbitmq_myport,
513
510
             'dtr-build-thread=i'       => \$opt_dtr_build_thread,
514
511
 
515
512
             # Test case authoring
615
612
             'help|h'                   => \$opt_usage,
616
613
            ) or usage("Can't read options");
617
614
 
 
615
  usage("") if $opt_usage;
 
616
 
618
617
  usage("you cannot specify --gdb and --dbx both!") if 
619
618
        ($opt_gdb && $opt_dbx) ||
620
619
        ($opt_manual_gdb && $opt_manual_dbx);
661
660
  # distributions, TAR binary distributions and some other packages.
662
661
  $glob_basedir= dirname($glob_drizzle_test_dir);
663
662
 
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
663
  # In the RPM case, binaries and libraries are installed in the
694
664
  # default system locations, instead of having our own private base
695
665
  # directory. And we install "/usr/share/drizzle-test". Moving up one
1170
1140
  $opt_slave_myport=          gimme_a_good_port($opt_master_myport + 2);  # and 3 4
1171
1141
  $opt_memc_myport= gimme_a_good_port($opt_master_myport + 10);
1172
1142
  $opt_pbms_myport= gimme_a_good_port($opt_master_myport + 11);
1173
 
  $opt_rabbitmq_myport= gimme_a_good_port($opt_master_myport + 12);
1174
1143
 
1175
1144
  if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
1176
1145
  {
1297
1266
  $exe_drizzledump= dtr_exe_exists("$path_client_bindir/drizzledump");
1298
1267
  $exe_drizzleimport= dtr_exe_exists("$path_client_bindir/drizzleimport");
1299
1268
  $exe_drizzle=          dtr_exe_exists("$path_client_bindir/drizzle");
1300
 
  $exe_drizzleadmin= dtr_exe_exists("$path_client_bindir/drizzleadmin");
1301
1269
 
1302
1270
  if (!$opt_extern)
1303
1271
  {
1352
1320
    " -uroot --port=$drizzled->{'port'} ";
1353
1321
}
1354
1322
 
1355
 
sub generate_cmdline_drizzleadmin ($) {
1356
 
  my($drizzled) = @_;
1357
 
  return
1358
 
    dtr_native_path($exe_drizzleadmin) .
1359
 
    " -uroot --port=$drizzled->{'port'} ";
1360
 
}
1361
1323
 
1362
1324
##############################################################################
1363
1325
#
1500
1462
  $ENV{'SLAVE_MYPORT1'}=      $slave->[1]->{'port'};
1501
1463
  $ENV{'SLAVE_MYPORT2'}=      $slave->[2]->{'port'};
1502
1464
  $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'};
 
1465
  $ENV{'PBMS_PORT'}=            $opt_pbms_myport;
 
1466
  $ENV{'DRIZZLE_TCP_PORT'}=     $drizzled_variables{'drizzle-protocol.port'};
1506
1467
 
1507
1468
  $ENV{'DTR_BUILD_THREAD'}=      $opt_dtr_build_thread;
1508
1469
 
1512
1473
  # ----------------------------------------------------
1513
1474
  # Setup env to childs can execute myqldump
1514
1475
  # ----------------------------------------------------
1515
 
  my $cmdline_drizzleadmin= generate_cmdline_drizzleadmin($master->[0]);
1516
1476
  my $cmdline_drizzledump= generate_cmdline_drizzledump($master->[0]);
1517
1477
  my $cmdline_drizzledumpslave= generate_cmdline_drizzledump($slave->[0]);
1518
1478
  my $cmdline_drizzledump_secondary= dtr_native_path($exe_drizzledump) .
1528
1488
    $cmdline_drizzledump_secondary .=
1529
1489
      " --debug=d:t:A,$path_vardir_trace/log/drizzledump-drizzle.trace";
1530
1490
  }
1531
 
  $ENV{'DRIZZLE_ADMIN'}= $cmdline_drizzleadmin;
1532
1491
  $ENV{'DRIZZLE_DUMP'}= $cmdline_drizzledump;
1533
1492
  $ENV{'DRIZZLE_DUMP_SLAVE'}= $cmdline_drizzledumpslave;
1534
1493
  $ENV{'DRIZZLE_DUMP_SECONDARY'}= $cmdline_drizzledump_secondary;
1660
1619
    print "Using SLAVE_MYPORT2         = $ENV{SLAVE_MYPORT2}\n";
1661
1620
    print "Using MC_PORT               = $ENV{MC_PORT}\n";
1662
1621
    print "Using PBMS_PORT             = $ENV{PBMS_PORT}\n";
1663
 
    print "Using RABBITMQ_NODE_PORT    = $ENV{RABBITMQ_NODE_PORT}\n";
1664
1622
  }
1665
1623
 
1666
1624
  # Create an environment variable to make it possible
3327
3285
  {
3328
3286
    # write init file for drizzled
3329
3287
    dtr_tofile($dbx_init_file,
3330
 
               "stop in __1cIdrizzledLparse6Fpn0AHSession_pkcI_v_\n" .
 
3288
               "stop in __1cIdrizzledLmysql_parse6Fpn0AHSession_pkcI_v_\n" .
3331
3289
               "runargs $str\n" .
3332
3290
               "run\n" .
3333
3291
               "\n");
3398
3356
               "set args $str\n" .
3399
3357
               "$extra_gdb_init" .
3400
3358
               "set breakpoint pending on\n" .
3401
 
               "break drizzled::parse\n" .
 
3359
               "break drizzled::mysql_parse\n" .
3402
3360
               "commands 1\n" .
3403
3361
               "disable 1\n" .
3404
3362
               "end\n" .
3464
3422
    dtr_tofile($gdb_init_file,
3465
3423
               "file $$exe\n" .
3466
3424
               "set args $str\n" .
3467
 
               "break drizzled::parse\n" .
 
3425
               "break drizzled::mysql_parse\n" .
3468
3426
               "commands 1\n" .
3469
3427
               "disable 1\n" .
3470
3428
               "end");