httpd-apreq-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran...@apache.org
Subject svn commit: r516765 - in /httpd/apreq/trunk/glue/perl/t/apreq: cgi.t upload.t
Date Sat, 10 Mar 2007 18:54:02 GMT
Author: randyk
Date: Sat Mar 10 10:54:01 2007
New Revision: 516765

URL: http://svn.apache.org/viewvc?view=rev&rev=516765
Log:
On Win32, the most recent ActivePerl switched the order of @INC, so that the the expected
system pod files used in the upload tests are not in the pod directory that Apache::Test picks
up. Instead, use files that are present in the pod directory that Apache::Test configures.


Modified:
    httpd/apreq/trunk/glue/perl/t/apreq/cgi.t
    httpd/apreq/trunk/glue/perl/t/apreq/upload.t

Modified: httpd/apreq/trunk/glue/perl/t/apreq/cgi.t
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/glue/perl/t/apreq/cgi.t?view=diff&rev=516765&r1=516764&r2=516765
==============================================================================
--- httpd/apreq/trunk/glue/perl/t/apreq/cgi.t (original)
+++ httpd/apreq/trunk/glue/perl/t/apreq/cgi.t Sat Mar 10 10:54:01 2007
@@ -15,8 +15,20 @@
 my @keys    = ('a'..'z');
 
 my $cwd = getcwd();
-my %types = (perl => 'application/octet-stream',
-             'perltoc.pod' => 'text/x-pod');
+
+my %types = (perl => 'application/octet-stream');
+my $vars = Apache::Test::vars;
+my $perlpod = $vars->{perlpod};
+if (-d $perlpod) {
+    opendir(my $dh, $perlpod);
+    my @files = grep { /\.(pod|pm)$/ } readdir $dh;
+    closedir $dh;
+    if (scalar @files > 0) {
+        my $file = $files[0];
+        $types{$file} = ($file =~ /\.pod$/) ? 'text/x-pod' : 'text/plain';
+    }
+}      
+
 my @names = sort keys %types;
 my @methods = sort qw/slurp fh tempname link io/;
 
@@ -160,7 +172,7 @@
 # file upload tests
 
 foreach my $name (@names) {
-    my $url = ( ($name =~ /\.pod$/) ?
+    my $url = ( ($name =~ /\.(pod|pm)$/) ?
         "getfiles-perl-pod/" : "/getfiles-binary-" ) . $name;
     my $content = GET_BODY_ASSERT($url);
     my $path = File::Spec->catfile($cwd, 't', $name);

Modified: httpd/apreq/trunk/glue/perl/t/apreq/upload.t
URL: http://svn.apache.org/viewvc/httpd/apreq/trunk/glue/perl/t/apreq/upload.t?view=diff&rev=516765&r1=516764&r2=516765
==============================================================================
--- httpd/apreq/trunk/glue/perl/t/apreq/upload.t (original)
+++ httpd/apreq/trunk/glue/perl/t/apreq/upload.t Sat Mar 10 10:54:01 2007
@@ -14,15 +14,28 @@
 
 my %types = (perl => 'application/octet-stream',
              httpd => 'application/octet-stream',
-             'perltoc.pod' => 'text/x-pod',
-             'perlport.pod' => 'text/x-pod');
+            );
+my $vars = Apache::Test::vars;
+my $perlpod = $vars->{perlpod};
+if (-d $perlpod) {
+    opendir(my $dh, $perlpod);
+    my @files = grep { /\.(pod|pm)$/ } readdir $dh;
+    closedir $dh;
+    if (scalar @files > 1) {
+        for my $i (0 .. 1) {
+            my $file = $files[$i];
+            $types{$file} = ($file =~ /\.pod$/) ? 'text/x-pod' : 'text/plain';
+        }
+    }      
+}
+
 my @names = sort keys %types;
 my @methods = sort qw/slurp fh tempname link io/;
 
 plan tests => @names * @methods, need_lwp;
 
 foreach my $name (@names) {
-    my $url = ( ($name =~ /\.pod$/) ?
+    my $url = ( ($name =~ /\.(pod|pm)$/) ?
         "getfiles-perl-pod/" : "/getfiles-binary-" ) . $name;
     my $content = GET_BODY_ASSERT($url);
     my $path = File::Spec->catfile($cwd, 't', $name);



Mime
View raw message