List:Commits« Previous MessageNext Message »
From:guilhem Date:July 6 2006 3:40pm
Subject:bk commit into 5.1 tree (guilhem:1.2224)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of guilhem. When guilhem does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2224 06/07/06 17:40:36 guilhem@stripped +3 -0
  Behaviour change of mysql-test-run.pl:
  by default we never run disabled tests (even if they're
  explicitely listed on the command-line). We add an option --enable-disabled
  which will run tests even though they are disabled, and will print, for each
  such test, the comment explaining why it was disabled.
  The reason for the change is when you want to run "all tests which are about
  NDB" for example: mysql-test-run.pl t/*ndb*.test used to run some disabled
  NDB tests, causing failures, causing investigations.
  Code amended and approved by Kent.

  mysql-test/mysql-test-run.pl
    1.125 06/07/06 17:40:26 guilhem@stripped +4 -2
    New behaviour: by default we never run disabled tests (even if they're
    explicitely listed on the command-line). We add an option --enable-disabled
    which will run tests even though they are disabled, and will print, for each
    such test, the comment explaining why it was disabled.

  mysql-test/lib/mtr_report.pl
    1.26 06/07/06 17:40:26 guilhem@stripped +18 -0
    Report tests which will run though they are listed as disabled
    (does something only if --enable-disabled).

  mysql-test/lib/mtr_cases.pl
    1.20 06/07/06 17:40:26 guilhem@stripped +38 -23
    always detect if a test is listed as disabled, and read the comment why is is.
    If it is listed, don't run the test, except if
    --enable-disabled was given, then mark the test as to-run-even-
    though-it-is-listed-as-disabled.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	guilhem
# Host:	gbichot3.local
# Root:	/home/mysql_src/mysql-5.1-new-WL3146-handler

--- 1.19/mysql-test/lib/mtr_cases.pl	2006-03-11 01:50:26 +01:00
+++ 1.20/mysql-test/lib/mtr_cases.pl	2006-07-06 17:40:26 +02:00
@@ -37,6 +37,23 @@
 
   opendir(TESTDIR, $testdir) or mtr_error("Can't open dir \"$testdir\": $!");
 
+  # ----------------------------------------------------------------------
+  # Disable some tests listed in disabled.def
+  # ----------------------------------------------------------------------
+  my %disabled;
+  if ( open(DISABLED, "$testdir/disabled.def" ) )
+  {
+    while ( <DISABLED> )
+      {
+        chomp;
+        if ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ )
+          {
+            $disabled{$1}= $2;
+          }
+      }
+    close DISABLED;
+  }
+
   if ( @::opt_cases )
   {
     foreach my $tname ( @::opt_cases ) { # Run in specified order, no sort
@@ -100,30 +117,13 @@
         }
       }
 
-      collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,{},
+      collect_one_test_case($testdir,$resdir,$tname,$elem,$cases,\%disabled,
         $component_id);
     }
     closedir TESTDIR;
   }
   else
   {
-    # ----------------------------------------------------------------------
-    # Disable some tests listed in disabled.def
-    # ----------------------------------------------------------------------
-    my %disabled;
-    if ( ! $::opt_ignore_disabled_def and open(DISABLED, "$testdir/disabled.def" ) )
-    {
-      while ( <DISABLED> )
-      {
-        chomp;
-        if ( /^\s*(\S+)\s*:\s*(.*?)\s*$/ )
-        {
-          $disabled{$1}= $2;
-        }
-      }
-      close DISABLED;
-    }
-
     foreach my $elem ( sort readdir(TESTDIR) ) {
       my $component_id= undef;
       my $tname= undef;
@@ -414,18 +414,33 @@
   }
 
   # FIXME why this late?
+  my $marked_as_disabled= 0;
   if ( $disabled->{$tname} )
   {
-    $tinfo->{'skip'}= 1;
-    $tinfo->{'disable'}= 1;   # Sub type of 'skip'
-    $tinfo->{'comment'}= $disabled->{$tname} if $disabled->{$tname};
+    $marked_as_disabled= 1;
+    $tinfo->{'comment'}= $disabled->{$tname};
   }
 
   if ( -f $disabled_file )
   {
-    $tinfo->{'skip'}= 1;
-    $tinfo->{'disable'}= 1;   # Sub type of 'skip'
+    $marked_as_disabled= 1;
     $tinfo->{'comment'}= mtr_fromfile($disabled_file);
+  }
+
+  # If test was marked as disabled, either opt_enable_disabled is off and then
+  # we skip this test, or it is on and then we run this test but warn
+
+  if ( $marked_as_disabled )
+  {
+    if ( $::opt_enable_disabled )
+    {
+      $tinfo->{'dont_skip_though_disabled'}= 1;
+    }
+    else
+    {
+      $tinfo->{'skip'}= 1;
+      $tinfo->{'disable'}= 1;   # Sub type of 'skip'
+    }
   }
 
   if ( $component_id eq 'im' )

--- 1.25/mysql-test/lib/mtr_report.pl	2006-05-05 19:08:36 +02:00
+++ 1.26/mysql-test/lib/mtr_report.pl	2006-07-06 17:40:26 +02:00
@@ -10,6 +10,7 @@
 sub mtr_report_test_passed($);
 sub mtr_report_test_failed($);
 sub mtr_report_test_skipped($);
+sub mtr_report_test_not_skipped_though_disabled($);
 
 sub mtr_show_failed_diff ($);
 sub mtr_report_stats ($);
@@ -97,6 +98,23 @@
   else
   {
     print "[ skipped ]\n";
+  }
+}
+
+sub mtr_report_tests_not_skipped_though_disabled ($) {
+  my $tests= shift;
+
+  if ( $::opt_enable_disabled )
+  {
+    my @disabled_tests= grep {$_->{'dont_skip_though_disabled'}} @$tests;
+    if ( @disabled_tests )
+    {
+      print "\nTest(s) which will be run though they are marked as disabled:\n";
+      foreach my $tinfo ( sort {$a->{'name'} cmp $b->{'name'}} @disabled_tests )
+      {
+        printf "  %-20s : %s\n", $tinfo->{'name'}, $tinfo->{'comment'};
+      }
+    }
   }
 }
 

--- 1.124/mysql-test/mysql-test-run.pl	2006-06-18 12:20:26 +02:00
+++ 1.125/mysql-test/mysql-test-run.pl	2006-07-06 17:40:26 +02:00
@@ -216,6 +216,7 @@
 our $opt_fast;
 our $opt_force;
 our $opt_reorder;
+our $opt_enable_disabled;
 
 our $opt_gcov;
 our $opt_gcov_err;
@@ -661,6 +662,7 @@
              'netware'                  => \$opt_netware,
              'old-master'               => \$opt_old_master,
              'reorder'                  => \$opt_reorder,
+             'enable-disabled'          => \$opt_enable_disabled,
              'script-debug'             => \$opt_script_debug,
              'sleep=i'                  => \$opt_sleep,
              'socket=s'                 => \$opt_socket,
@@ -1781,11 +1783,11 @@
 
   mtr_print_thick_line();
 
-  mtr_report("Finding  Tests in the '$suite' suite");
-
   mtr_timer_start($glob_timers,"suite", 60 * $opt_suite_timeout);
 
   mtr_report("Starting Tests in the '$suite' suite");
+
+  mtr_report_tests_not_skipped_though_disabled($tests);
 
   mtr_print_header();
 
Thread
bk commit into 5.1 tree (guilhem:1.2224)guilhem6 Jul