httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache Test.pm
Date Wed, 22 Jan 2003 06:52:44 GMT
stas        2003/01/21 22:52:44

  Modified:    perl-framework/Apache-Test/lib/Apache Test.pm
  Log:
  add another shortcut test: have_threads, to test for having threads
  enabled, both in perl and apache
  
  Revision  Changes    Path
  1.50      +23 -1     httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm
  
  Index: Test.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/Test.pm,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- Test.pm	30 Sep 2002 21:21:44 -0000	1.49
  +++ Test.pm	22 Jan 2003 06:52:44 -0000	1.50
  @@ -13,7 +13,7 @@
   @ISA = qw(Exporter);
   @EXPORT = qw(ok skip sok plan have have_lwp have_http11
                have_cgi have_access have_auth have_module
  -             have_apache have_perl);
  +             have_apache have_perl have_threads);
   $VERSION = '0.01';
   
   %SubTests = ();
  @@ -262,6 +262,28 @@
   
       return 0;
   }
  +
  +sub have_threads {
  +    my $status = 1;
  +
  +    # check APR support
  +    my $build_config = Apache::TestConfig->modperl_build_config;
  +    my $apr_config = $build_config->get_apr_config();
  +    unless ($apr_config->{HAS_THREADS}) {
  +        $status = 0;
  +        push @SkipReasons, "Apache/APR was built without threads support";
  +    }
  +
  +    # check Perl's useithreads
  +    my $key = 'useithreads';
  +    unless (exists $Config{$key} and config_enabled($key)) {
  +        $status = 0;
  +        push @SkipReasons, "Perl was not built with 'ithreads' enabled";
  +    }
  +
  +    return $status;
  +}
  +
   
   package Apache::TestToString;
   
  
  
  

Mime
View raw message