perl-test-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tors...@apache.org
Subject svn commit: r1062470 - /perl/Apache-Test/trunk/lib/Apache/TestHarness.pm
Date Sun, 23 Jan 2011 17:14:00 GMT
Author: torsten
Date: Sun Jan 23 17:14:00 2011
New Revision: 1062470

URL: http://svn.apache.org/viewvc?rev=1062470&view=rev
Log:
more or less cosmetical, this patch prevents repeating info lines in the
output while testing Apache::Test, SizeLimit and similar:

  [   info] adding source lib .../Apache-Test/lib to @INC

Modified:
    perl/Apache-Test/trunk/lib/Apache/TestHarness.pm

Modified: perl/Apache-Test/trunk/lib/Apache/TestHarness.pm
URL: http://svn.apache.org/viewvc/perl/Apache-Test/trunk/lib/Apache/TestHarness.pm?rev=1062470&r1=1062469&r2=1062470&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestHarness.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestHarness.pm Sun Jan 23 17:14:00 2011
@@ -61,49 +61,47 @@ sub skip {
 }
 
 #test if all.t would skip tests or not
-sub run_t {
-    my($self, $file) = @_;
-    my $ran = 0;
-
+{
     my $source_lib = '';
 
-    if (Apache::TestConfig::IS_APACHE_TEST_BUILD) {
-        # so we can find Apache/Test.pm from both the perl-framework/
-        # and Apache-Test/
-
-        my $top_dir = Apache::Test::vars('top_dir');
-
-        foreach my $lib (catfile($top_dir, qw(Apache-Test lib)),
-                         catfile($top_dir, qw(.. Apache-Test lib)),
-                         catfile($top_dir, 'lib')) {
-
-            if (-d $lib) {
-
-                info "adding source lib $lib to \@INC";
-
-                $source_lib = qq[-Mlib="$lib"];
-
-                last;
+    sub run_t {
+        my($self, $file) = @_;
+        my $ran = 0;
+
+        if (Apache::TestConfig::IS_APACHE_TEST_BUILD and !length $source_lib) {
+            # so we can find Apache/Test.pm from both the perl-framework/
+            # and Apache-Test/
+
+            my $top_dir = Apache::Test::vars('top_dir');
+            foreach my $lib (catfile($top_dir, qw(Apache-Test lib)),
+                             catfile($top_dir, qw(.. Apache-Test lib)),
+                             catfile($top_dir, 'lib')) {
+
+                if (-d $lib) {
+                    info "adding source lib $lib to \@INC";
+                    $source_lib = qq[-Mlib="$lib"];
+                    last;
+                }
             }
         }
-    }
 
-    my $cmd = qq[$^X $source_lib $file];
+        my $cmd = qq[$^X $source_lib $file];
 
-    my $h = Symbol::gensym();
-    open $h, "$cmd|" or die "open $cmd: $!";
+        my $h = Symbol::gensym();
+        open $h, "$cmd|" or die "open $cmd: $!";
 
-    local $_;
-    while (<$h>) {
-        if (/^1\.\.(\d)/) {
-            $ran = $1;
-            last;
+        local $_;
+        while (<$h>) {
+            if (/^1\.\.(\d)/) {
+                $ran = $1;
+                last;
+            }
         }
-    }
 
-    close $h;
+        close $h;
 
-    $ran;
+        $ran;
+     }
 }
 
 #if a directory has an all.t test



Mime
View raw message