~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/test-run.pl

doStartTableScan() result not checked.

Add __attribute__((warn_unused_result)) to Cursor::startTableScan()
and by extension init_read_records

then go and fix the places where we weren't checking for errors.

This patch helped by Monty Widenius' patch to MariaDB. Greatly increased
confidence that we either handle the errors correctly or are at least
on par with bugs :)

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 "execute"; # Eats up a lot of CPU
678
 
          next if $elem eq "stress"; # Currently fails
679
 
          next if $elem eq "broken"; # Old broken test, mainly unsupported featurs
680
 
 
681
 
          my $local_dir= "$suitedir/$elem";
682
 
 
683
 
          next unless -d $local_dir;
684
 
          next unless -d "$local_dir/t"; # We want to make sure it has tests
685
 
          next unless -d "$local_dir/r"; # Ditto, results
686
 
 
687
 
          $opt_suites_default.= ",$elem";
688
 
      }
689
 
      closedir(SUITE_DIR);
690
 
  }
691
 
 
692
 
  usage("") if $opt_usage;
693
 
 
694
664
  # In the RPM case, binaries and libraries are installed in the
695
665
  # default system locations, instead of having our own private base
696
666
  # directory. And we install "/usr/share/drizzle-test". Moving up one
1171
1141
  $opt_slave_myport=          gimme_a_good_port($opt_master_myport + 2);  # and 3 4
1172
1142
  $opt_memc_myport= gimme_a_good_port($opt_master_myport + 10);
1173
1143
  $opt_pbms_myport= gimme_a_good_port($opt_master_myport + 11);
1174
 
  $opt_rabbitmq_myport= gimme_a_good_port($opt_master_myport + 12);
1175
1144
 
1176
1145
  if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
1177
1146
  {
1501
1470
  $ENV{'SLAVE_MYPORT1'}=      $slave->[1]->{'port'};
1502
1471
  $ENV{'SLAVE_MYPORT2'}=      $slave->[2]->{'port'};
1503
1472
  $ENV{'MC_PORT'}=            $opt_memc_myport;
1504
 
  $ENV{'PBMS_PORT'}=          $opt_pbms_myport;
1505
 
  $ENV{'RABBITMQ_NODE_PORT'}= $opt_rabbitmq_myport;
1506
 
  $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'};
1507
1475
 
1508
1476
  $ENV{'DTR_BUILD_THREAD'}=      $opt_dtr_build_thread;
1509
1477
 
1661
1629
    print "Using SLAVE_MYPORT2         = $ENV{SLAVE_MYPORT2}\n";
1662
1630
    print "Using MC_PORT               = $ENV{MC_PORT}\n";
1663
1631
    print "Using PBMS_PORT             = $ENV{PBMS_PORT}\n";
1664
 
    print "Using RABBITMQ_NODE_PORT    = $ENV{RABBITMQ_NODE_PORT}\n";
1665
1632
  }
1666
1633
 
1667
1634
  # Create an environment variable to make it possible