perl-docs-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: modperl-docs/src/devel/writing_tests writing_tests.pod
Date Wed, 19 Sep 2001 09:02:36 GMT
stas        01/09/19 02:02:36

  Modified:    src/devel/writing_tests writing_tests.pod
  Log:
  - starting the auto config section
  - adding a note about ithread vs non-thread test's code/config
  
  Revision  Changes    Path
  1.7       +53 -1     modperl-docs/src/devel/writing_tests/writing_tests.pod
  
  Index: writing_tests.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/devel/writing_tests/writing_tests.pod,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- writing_tests.pod	2001/09/19 02:06:20	1.6
  +++ writing_tests.pod	2001/09/19 09:02:36	1.7
  @@ -704,7 +704,7 @@
   
     plan tests => 2, have_perl 'ithreads';
   
  -and if the Perl wasn't compiled with C<-Dusethreads> the condition
  +and if the Perl wasn't compiled with C<-Duseithreads> the condition
   will be false and the test will be skipped.
   
   =item * have_lwp()
  @@ -725,6 +725,58 @@
   
   
   =back
  +
  +
  +=head2 Auto Configuration
  +
  +C<Apache::Test> automatically adds the configuration section for each
  +response part. If you put some configuration bits into the C<__DATA__>
  +section of the response part, which declares a package:
  +
  +  package TestResponse::nice;
  +  ... some code
  +  1;
  +  __DATA__
  +  PerlRequire "Foo.pm"
  +
  +these will be wrapped into the E<lt>LocationE<gt> section and placed
  +into configuration file for you:
  +
  +  <Location /TestResponse::nice>
  +     SetHandler modperl
  +     PerlResponseHandler TestResponse::nice
  +     PerlRequire "Foo.pm"
  +  </Location>
  +
  +META: to be completed
  +
  +=head2 Tests with Non-threads perl versus threaded Perl
  +
  +Since the tests are supposed to run properly under non-threaded and
  +threaded perl, you have to worry to enclose the threaded perl specific
  +configuration bits in:
  +
  +  <IfDefine PERL_USEITHREADS>
  +      ... configuration bits
  +  </IfDefine>
  +
  +For example C<PerlOptions +Parent> is valid only for the threaded
  +perl, therefore you have to write:
  +
  +  <IfDefine PERL_USEITHREADS>
  +     # a new interpreter pool
  +     PerlOptions +Parent
  +  </IfDefine>
  +
  +Just like the configuration, the test's code has to work for both
  +versions as well. Therefore you should wrap the code specific to the
  +threaded perl into:
  +
  +  if (have_perl 'ithreads'){
  +      # ithread specific code
  +  }
  +
  +which is essentially does a lookup in $Config{useithreads}.
   
   
   =head1 When Tests Should Be Written
  
  
  

Mime
View raw message