List:Commits« Previous MessageNext Message »
From:John David Duncan Date:May 12 2011 4:04pm
Subject:bzr commit into mysql-5.1-telco-7.1 branch (john.duncan:4191)
View as plain text  
#At file:///Users/jdd/bzr-repo/working/mysql-5.1-telco-7.1/ based on revid:jonas@stripped

 4191 John David Duncan	2011-05-12
      Smarter test for junit jar file.

    modified:
      mysql-test/suite/ndb/include/have_junit.inc
=== modified file 'mysql-test/suite/ndb/include/have_junit.inc'
--- a/mysql-test/suite/ndb/include/have_junit.inc	2010-02-03 10:11:55 +0000
+++ b/mysql-test/suite/ndb/include/have_junit.inc	2011-05-12 16:04:16 +0000
@@ -2,19 +2,35 @@
 use strict;
 use IO::File;
 
-#
-# Looks for JUnit JAR file in MTR_CLASSPATH
-#
-
+my $ok = 0;
 my $classpath = $ENV{'MTR_CLASSPATH'} || '';
-
 my $vardir = $ENV{MYSQLTEST_VARDIR} or die "Need MYSQLTEST_VARDIR";
+my $jar;
+my $notfound;
+
+# -- look for the junit jar file
+foreach $jar (split ':', $classpath) {
+  if($jar =~ m/junit/  && -f $jar) {
+    $ok = 2;
+  }
+  elsif($jar =~ m/junit/) {
+    $ok = 1;
+    $notfound = $jar;
+  }
+}
+
+# -- write the result to the output file
 my $F = IO::File->new("$vardir/tmp/have_junit_result.inc", "w") or die;
-if ($classpath =~ m/junit/) {
-  print $F "--echo Found JUnit JAR in MTR_CLASSPATH\n";
-} else {
-  print $F "--skip Could not find JUnit JAR file, please set MTR_CLASSPATH env variable\n";
+if($ok == 2) {
+  print $F  "--echo Found JUnit JAR in MTR_CLASSPATH\n";
+}
+elsif($ok == 1) {
+  print $F  "--skip JAR file not found: \"$notfound\"\n";
+} 
+else {
+  print $F  "--skip Please specify Junit JAR file in MTR_CLASSPATH env variable\n";
 }
+
 $F->close();
 
 EOF


Attachment: [text/bzr-bundle] bzr/john.duncan@oracle.com-20110512160416-ted329ybf6vdbfnt.bundle
Thread
bzr commit into mysql-5.1-telco-7.1 branch (john.duncan:4191) John David Duncan12 May