You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-commits@perl.apache.org by to...@apache.org on 2011/01/23 18:14:00 UTC

svn commit: r1062470 - /perl/Apache-Test/trunk/lib/Apache/TestHarness.pm

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