home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / TestRun.pm < prev    next >
Encoding:
Perl POD Document  |  2004-01-28  |  1.2 KB  |  51 lines

  1. package ModPerl::TestRun;
  2.  
  3. use strict;
  4. use warnings FATAL => 'all';
  5.  
  6. use base qw(Apache::TestRunPerl);
  7.  
  8. use Apache::Build;
  9.  
  10. # some mp2 tests require more than one server instance to be available
  11. # without which the server may hang, waiting for the single server
  12. # become available
  13. use constant MIN_MAXCLIENTS => 2;
  14.  
  15. sub new_test_config {
  16.     my $self = shift;
  17.  
  18.     # default timeout in secs (threaded mpms are extremely slow to
  19.     # startup, due to a slow perl_clone operation)
  20.     $self->{conf_opts}->{startup_timeout} ||=
  21.         Apache::Build->build_config->mpm_is_threaded() ? 180 : 120;
  22.  
  23.     $self->{conf_opts}->{maxclients} ||= MIN_MAXCLIENTS;
  24.  
  25.     ModPerl::TestConfig->new($self->{conf_opts});
  26. }
  27.  
  28. sub bug_report {
  29.     my $self = shift;
  30.  
  31.     print <<EOI;
  32. +--------------------------------------------------------+
  33. | Please file a bug report: http://perl.apache.org/bugs/ |
  34. +--------------------------------------------------------+
  35. EOI
  36. }
  37.  
  38. package ModPerl::TestConfig;
  39.  
  40. use base qw(Apache::TestConfig);
  41.  
  42. # don't inherit LoadModule perl_module from the apache httpd.conf
  43. sub should_skip_module {
  44.     my($self, $name) = @_;
  45.  
  46.     $name eq 'mod_perl.c' ? 1 : $self->SUPER::should_skip_module($name);
  47. }
  48.  
  49. 1;
  50.  
  51.