perl-test-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r202418 - in /perl/Apache-Test/branches/test-more-unstable: ./ Changes META.yml Makefile.PL RELEASE lib/Apache/Test.pm lib/Apache/TestConfig.pm lib/Apache/TestConfigParse.pm lib/Apache/TestUtil.pm
Date Wed, 29 Jun 2005 19:42:40 GMT
Author: stas
Date: Wed Jun 29 12:42:37 2005
New Revision: 202418

URL: http://svn.apache.org/viewcvs?rev=202418&view=rev
Log:
sync with trunk 165202 => 191202


Modified:
    perl/Apache-Test/branches/test-more-unstable/   (props changed)
    perl/Apache-Test/branches/test-more-unstable/Changes
    perl/Apache-Test/branches/test-more-unstable/META.yml
    perl/Apache-Test/branches/test-more-unstable/Makefile.PL
    perl/Apache-Test/branches/test-more-unstable/RELEASE
    perl/Apache-Test/branches/test-more-unstable/lib/Apache/Test.pm
    perl/Apache-Test/branches/test-more-unstable/lib/Apache/TestConfig.pm
    perl/Apache-Test/branches/test-more-unstable/lib/Apache/TestConfigParse.pm
    perl/Apache-Test/branches/test-more-unstable/lib/Apache/TestUtil.pm

Propchange: perl/Apache-Test/branches/test-more-unstable/
------------------------------------------------------------------------------
    merge-point = 191202

Modified: perl/Apache-Test/branches/test-more-unstable/Changes
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Changes?rev=202418&r1=202417&r2=202418&view=diff
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Changes (original)
+++ perl/Apache-Test/branches/test-more-unstable/Changes Wed Jun 29 12:42:37 2005
@@ -6,7 +6,35 @@
 
 =over 3
 
-=item 1.23-dev
+=item 1.26-dev
+
+
+
+=item 1.25 - June 17, 2005
+
+provide $Apache::TestUtil::DEBUG_OUTPUT as target for t_debug()
+statements, defaulting to STDOUT.  this allows for changing
+t_debug() to STDERR when using functions like t_write_file()
+from within handler() server-side tests.  [Geoffrey Young]
+
+adjust need_module()/have_module() to not try to require a module if
+it was explicitly passed with a .c extension. in certain cases this
+prevents a fatal error (e.g. trying to call
+Apache::Test::have_module('mod_alias.c') from the <Perl>
+sections. [Stas]
+
+
+
+=item 1.24 - May 20, 2005
+
+When adding TypesConfig directives (either inherited from the global
+httpd.conf or from the locally generated mime.types) make sure to
+enclose it in <IfModule mod_mime.c>..</IfModule>, since mod_mime might
+be unavailable. [Stas]
+
+
+
+=item 1.23 - May 3, 2005
 
 Fix Apache::TestRequest::hostport to return the default host:port
 string if $Apache::TestRequest::Module is 'default' or undef [Stas]
@@ -19,7 +47,7 @@
 
 
 
-=item 1.22
+=item 1.22 - April 14, 2005
 
     ******************** IMPORTANT ********************
       this version of Apache-Test does not completely

Modified: perl/Apache-Test/branches/test-more-unstable/META.yml
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/META.yml?rev=202418&r1=202417&r2=202418&view=diff
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/META.yml (original)
+++ perl/Apache-Test/branches/test-more-unstable/META.yml Wed Jun 29 12:42:37 2005
@@ -12,6 +12,8 @@
     package:
         - HTTP::Request::Common
         - warnings
+        - TestMore::testmorepm
+        - TestMore::testpm
     directory:
         - Apache-TestItSelf
         - Test-Simple

Modified: perl/Apache-Test/branches/test-more-unstable/Makefile.PL
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Makefile.PL?rev=202418&r1=202417&r2=202418&view=diff
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Makefile.PL (original)
+++ perl/Apache-Test/branches/test-more-unstable/Makefile.PL Wed Jun 29 12:42:37 2005
@@ -172,7 +172,7 @@
 
     $string .= <<'EOF';
 tag :
-	svn copy . https://svn.apache.org/repos/asf/perl/Apache-Test/tags/APACHE_TEST_$(VERSION_SYM)
+	svn copy https://svn.apache.org/repos/asf/perl/Apache-Test/trunk https://svn.apache.org/repos/asf/perl/Apache-Test/tags/$(VERSION_SYM)
 	@echo update lib/Apache/Test.pm VERSION now
 EOF
 

Modified: perl/Apache-Test/branches/test-more-unstable/RELEASE
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/RELEASE?rev=202418&r1=202417&r2=202418&view=diff
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/RELEASE (original)
+++ perl/Apache-Test/branches/test-more-unstable/RELEASE Wed Jun 29 12:42:37 2005
@@ -54,7 +54,7 @@
 5. Announce the package
 
   a. post ... to the modperl, announce lists
-  Subject: [ANNOUNCE] Apache-Test 1.23
+  Subject: [ANNOUNCE] Apache-Test 1.26
      include 
   - MD5 sig (as it comes from CPAN upload announce).
   - the latest Changes
@@ -66,16 +66,16 @@
   b. edit ./Changes:
      - start a new item with incremented version + '-dev'
 
-  =item 1.24-dev
+  =item 1.27-dev
 
   c. bump up version numbers in this file to make it easier to do the
      next release.
 
-   perl -pi -e 's/\.24/.25/g' RELEASE
-   perl -pi -e 's/\.23/.24/g' RELEASE
+   perl -pi -e 's/\.27/.27/g' RELEASE
+   perl -pi -e 's/\.26/.27/g' RELEASE
 
      now reload this file and bump up the last number of the first
      command.
 
   d. commit Changes
-     % svn ci Changes RELEASE lib/Apache/Test.pm
+     % svn ci -m "start 1.26-dev cycle" Changes RELEASE lib/Apache/Test.pm

Modified: perl/Apache-Test/branches/test-more-unstable/lib/Apache/Test.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/lib/Apache/Test.pm?rev=202418&r1=202417&r2=202418&view=diff
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/lib/Apache/Test.pm (original)
+++ perl/Apache-Test/branches/test-more-unstable/lib/Apache/Test.pm Wed Jun 29 12:42:37 2005
@@ -27,7 +27,7 @@
 
 use vars qw(@ISA @EXPORT %EXPORT_TAGS $VERSION %SubTests @SkipReasons);
 
-$VERSION = '1.23';
+$VERSION = '1.26';
 
 my @need = qw(need_lwp need_http11 need_cgi need_access need_auth
               need_module need_apache need_min_apache_version
@@ -278,11 +278,17 @@
             }
         }
         die "bogus module name $_" unless /^[\w:.]+$/;
-        eval "require $_";
-        #print $@ if $@;
-        if ($@) {
-            push @reasons, "cannot find module '$_'";
+
+        # if the module was explicitly passed with a .c extension,
+        # do not try to eval it as a Perl module
+        my $not_found = 1;
+        unless (/\.c$/) {
+            eval "require $_";
+            $not_found = 0 unless $@;
+            #print $@ if $@;
         }
+        push @reasons, "cannot find module '$_'" if $not_found;
+
     }
     if (@reasons) {
         push @SkipReasons, @reasons;

Modified: perl/Apache-Test/branches/test-more-unstable/lib/Apache/TestConfig.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/lib/Apache/TestConfig.pm?rev=202418&r1=202417&r2=202418&view=diff
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/lib/Apache/TestConfig.pm (original)
+++ perl/Apache-Test/branches/test-more-unstable/lib/Apache/TestConfig.pm Wed Jun 29 12:42:37
2005
@@ -1283,7 +1283,11 @@
             print $fh $self->types_config_template;
             close $fh;
         }
-        $self->postamble(TypesConfig => qq("$types"));
+        $self->postamble(<<EOI);
+<IfModule mod_mime.c>
+    TypesConfig "$types"
+</IfModule>
+EOI
     }
 }
 

Modified: perl/Apache-Test/branches/test-more-unstable/lib/Apache/TestConfigParse.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/lib/Apache/TestConfigParse.pm?rev=202418&r1=202417&r2=202418&view=diff
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/lib/Apache/TestConfigParse.pm (original)
+++ perl/Apache-Test/branches/test-more-unstable/lib/Apache/TestConfigParse.pm Wed Jun 29
12:42:37 2005
@@ -50,11 +50,27 @@
 #where to add config, default is preamble
 my %spec_postamble = map { $_, 'postamble' } qw(TypesConfig);
 
+# need to enclose the following directives into <IfModule
+# mod_foo.c>..</IfModule>, since mod_foo might be unavailable
+my %ifmodule = (
+    TypesConfig => 'mod_mime.c',
+);
+
 sub spec_add_config {
     my($self, $directive, $val) = @_;
 
     my $where = $spec_postamble{$directive} || 'preamble';
-    $self->$where($directive => $val);
+
+    if (my $ifmodule = $ifmodule{TypesConfig}) {
+        $self->postamble(<<EOI);
+<IfModule $ifmodule>
+    $directive $val
+</IfModule>
+EOI
+    }
+    else {
+        $self->$where($directive => $val);
+    }
 }
 
 # resolve relative files like Apache->server_root_relative

Modified: perl/Apache-Test/branches/test-more-unstable/lib/Apache/TestUtil.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/lib/Apache/TestUtil.pm?rev=202418&r1=202417&r2=202418&view=diff
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/lib/Apache/TestUtil.pm (original)
+++ perl/Apache-Test/branches/test-more-unstable/lib/Apache/TestUtil.pm Wed Jun 29 12:42:37
2005
@@ -45,6 +45,8 @@
 
 %CLEAN = ();
 
+$Apache::TestUtil::DEBUG_OUTPUT = \*STDOUT;
+
 # 5.005's Data::Dumper has problems to dump certain datastructures
 use constant HAS_DUMPER => eval { $] >= 5.6 && require Data::Dumper; };
 use constant INDENT     => 4;
@@ -145,7 +147,8 @@
     sub { @_ };
 
 sub t_debug {
-    print map {"# $_\n"} map {split /\n/} grep {defined} expand(@_);
+    my $out = $Apache::TestUtil::DEBUG_OUTPUT;
+    print $out map {"# $_\n"} map {split /\n/} grep {defined} expand(@_);
 }
 
 sub t_open_file {
@@ -497,6 +500,26 @@
 for debug prints, since if in the future the debug printing will
 change (e.g. redirected into a file) your tests won't need to be
 changed.
+
+the special global variable $Apache::TestUtil::DEBUG_OUTPUT can
+be used to redirect the output from t_debug() and related calls
+such as t_write_file().  for example, from a server-side test
+you would probably need to redirect it to STDERR:
+
+  sub handler {
+    plan $r, tests => 1;
+
+    local $Apache::TestUtil::DEBUG_OUTPUT = \*STDERR;
+
+    t_write_file('/tmp/foo', 'bar');
+    ...
+  }
+
+left to its own devices, t_debug() will collide with the standard
+HTTP protocol during server-side tests, resulting in a situation
+both confusing difficult to debug.  but STDOUT is left as the
+default, since you probably don't want debug output under normal
+circumstances unless running under verbose mode.
 
 This function is exported by default.
 



Mime
View raw message