List:Commits« Previous MessageNext Message »
From:Magnus Svensson Date:November 14 2008 12:21pm
Subject:bzr commit into mysql-6.0-rpl branch (msvensson:2729)
View as plain text  
#At file:///home/msvensson/mysql/6.0-rpl/

 2729 Magnus Svensson	2008-11-14 [merge]
      Merge
modified:
  client/mysqltest.cc
  mysql-test/lib/My/Test.pm
  mysql-test/mysql-test-run.pl

=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2008-11-14 08:46:05 +0000
+++ b/client/mysqltest.cc	2008-11-14 12:21:06 +0000
@@ -518,15 +518,22 @@ public:
 
   void close()
   {
-    if (m_file && m_file != stdout)
-      fclose(m_file);
+    if (m_file) {
+      if (m_file != stdout)
+        fclose(m_file);
+      else
+        fflush(m_file);
+    }
     m_file= NULL;
   }
 
   void flush()
   {
     if (m_file && m_file != stdout)
-      fflush(m_file);
+    {
+      if (fflush(m_file))
+        die("Failed to flush '%s', errno: %d", m_file_name, errno);
+    }
   }
 
   void write(DYNAMIC_STRING* ds)

=== modified file 'mysql-test/lib/My/Test.pm'
--- a/mysql-test/lib/My/Test.pm	2008-04-24 11:02:53 +0000
+++ b/mysql-test/lib/My/Test.pm	2008-11-14 10:49:12 +0000
@@ -26,9 +26,7 @@ sub new {
 #
 sub key {
   my ($self)= @_;
-  my $key= $self->{name};
-  $key.= "+".$self->{combination} if $self->{combination};
-  return $key;
+  return $self->{key};
 }
 
 
@@ -57,6 +55,9 @@ sub is_failed {
 sub write_test {
   my ($test, $sock, $header)= @_;
 
+  # Give the test a unique key before serializing it
+  $test->{key}= "$test" unless defined $test->{key};
+
   print $sock $header, "\n";
   while ((my ($key, $value)) = each(%$test)) {
     print $sock  $key, "= ";

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2008-11-14 09:26:48 +0000
+++ b/mysql-test/mysql-test-run.pl	2008-11-14 12:21:06 +0000
@@ -2850,7 +2850,8 @@ sub check_testcase($$)
 	{
 	  my $report= mtr_grab_file($err_file);
 	  $tinfo->{comment}.=
-	    "Could not execute 'check-testcase' $mode testcase '$tname':\n";
+	    "Could not execute 'check-testcase' $mode ".
+	      "testcase '$tname' (res: $res):\n";
 	  $tinfo->{comment}.= $report;
 
 	  $result= 2;
@@ -3207,19 +3208,15 @@ sub run_testcase ($) {
 
       my $res= $test->exit_status();
 
-      if ( $res == 0 )
+      if ($res == 0 and $opt_warnings and check_warnings($tinfo) )
       {
-	if ( $opt_warnings and check_warnings($tinfo) )
-	{
-	  # Found unexpected warnings
-	  report_failure_and_restart($tinfo);
-	  $res= 1;
-	}
-	else
-	{
-	  mtr_report_test_passed($tinfo);
-	}
+	# Test case suceeded, but it has produced unexpected
+	# warnings, continue in $res == 1
+	$res= 1;
+      }
 
+      if ( $res == 0 )
+      {
 	my $check_res;
 	if ( $opt_check_testcases and
 	     $check_res= check_testcase($tinfo, "after"))
@@ -3235,6 +3232,7 @@ sub run_testcase ($) {
 	    return 1;
 	  }
 	}
+	mtr_report_test_passed($tinfo);
       }
       elsif ( $res == 62 )
       {
@@ -3455,7 +3453,8 @@ sub check_warnings ($) {
       {
 	my $report= mtr_grab_file($err_file);
 	$tinfo->{comment}.=
-	  "Could not execute 'check-warnings' for testcase '$tname':";
+	  "Could not execute 'check-warnings' for ".
+	    "testcase '$tname' (res: $res):\n";
 	$tinfo->{comment}.= $report;
 
 	$result= 2;
@@ -3476,11 +3475,6 @@ sub check_warnings ($) {
     return $result;
   }
 
-
-
-
-  return $res;
-
   return $res;
 }
 

Thread
bzr commit into mysql-6.0-rpl branch (msvensson:2729) Magnus Svensson14 Nov