httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject [patch] move Apache2 setup into a common file
Date Thu, 13 Jan 2005 04:43:11 GMT
As Test::Inline doesn't allow to prepand common test setup code, the 
following patch does that by introducing t/lib/TestApReq/DocSetup.pm.

Then 'use Apache2', which doesn't belong to the actual tests is moved 
there. when mp2.2 is released we will automate the generation of this 
file, so the right 'use Apache2_X' will be there.

Index: glue/perl/t/lib/TestApReq/DocSetup.pm
===================================================================
--- glue/perl/t/lib/TestApReq/DocSetup.pm	(revision 0)
+++ glue/perl/t/lib/TestApReq/DocSetup.pm	(revision 0)
@@ -0,0 +1,7 @@
+package TestApReq::DocSetup;
+
+# common things needed to run inlined doc tests go here
+
+use Apache2; # XXX: automate this
+
+1;

Property changes on: glue/perl/t/lib/TestApReq/DocSetup.pm
___________________________________________________________________
Name: svn:eol-style
    + native

Index: glue/perl/Makefile.PL
===================================================================
--- glue/perl/Makefile.PL	(revision 125034)
+++ glue/perl/Makefile.PL	(working copy)
@@ -224,9 +224,11 @@
      my @tests = @docs;
      s/pod$/t/ for @tests;

+    my $test_lib = catfile qw(t lib);
+
      return copy_docs(@docs) . test_docs(\@docs,\@tests) . <<EOT;
  doc_test : @tests
-	\$(FULLPERLRUN) "-Mblib" "-MTest::Harness" "-e" "runtests(\@ARGV)" @tests
+	\$(FULLPERLRUN) "-Mblib" "-I$test_lib" "-MTest::Harness" "-e" 
"runtests(\@ARGV)" @tests

  test :: doc_test

Index: glue/perl/docs/Upload.pod
===================================================================
--- glue/perl/docs/Upload.pod	(revision 125026)
+++ glue/perl/docs/Upload.pod	(working copy)
@@ -3,7 +3,7 @@
  Apache::Upload - Methods for dealing with file uploads.

  =for testing
-    use Apache2;
+    use TestApReq::DocSetup;
      use APR::Pool;
      use Apache::Upload;
      $r = APR::Pool->new;
Index: glue/perl/docs/Table.pod
===================================================================
--- glue/perl/docs/Table.pod	(revision 125026)
+++ glue/perl/docs/Table.pod	(working copy)
@@ -3,7 +3,7 @@
  Apache::*::Table - Table classes for Apache::Request, Apache::Upload, 
and Apache::Cookie.

  =for testing
-    use Apache2;
+    use TestApReq::DocSetup;
      use Apache::Upload;
      use Apache::Cookie;
      use APR::Pool;
Index: glue/perl/docs/Request.pod
===================================================================
--- glue/perl/docs/Request.pod	(revision 125026)
+++ glue/perl/docs/Request.pod	(working copy)
@@ -4,7 +4,7 @@


  =for testing
-    use Apache2;
+    use TestApReq::DocSetup;
      use Apache::Request;
      use Apache::Upload;
      use APR::Pool;
Index: glue/perl/docs/Cookie.pod
===================================================================
--- glue/perl/docs/Cookie.pod	(revision 125026)
+++ glue/perl/docs/Cookie.pod	(working copy)
@@ -3,7 +3,7 @@
  Apache::Cookie, Apache::Cookie::Jar - HTTP Cookies Class

  =for testing
-    use Apache2;
+    use TestApReq::DocSetup;
      use Apache::Cookie;
      use APR::Pool;
      # use $r instead of $p here, so doc examples reflect mp2 env, not 
CGI/test env
Index: glue/perl/docs/Error.pod
===================================================================
--- glue/perl/docs/Error.pod	(revision 125026)
+++ glue/perl/docs/Error.pod	(working copy)
@@ -3,7 +3,7 @@
  Apache::*::Error - Exception classes for Apache::Request, 
Apache::Upload, Apache::Cookie::Jar and Apache::Cookie

  =for testing
-    use Apache2;
+    use TestApReq::DocSetup;
      use Apache::Upload;
      use Apache::Cookie;
      use APR::Error;

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Mime
View raw message