dougm 01/12/07 11:27:07
Modified: perl-framework/Apache-Test/lib/Apache Test.pm
Log:
add support to have_perl() for testing more than %Config::Config defined
values
add have_perl_iolayers() (can be used via: have_perl 'iolayers')
Revision Changes Path
1.39 +19 -4 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.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- Test.pm 2001/12/05 19:56:24 1.38
+++ Test.pm 2001/12/07 19:27:07 1.39
@@ -207,15 +207,30 @@
defined $Config{$key} and $Config{$key} eq 'define';
}
+sub have_perl_iolayers {
+ if (my $ext = $Config{extensions}) {
+ #XXX: better test? might need to test patchlevel
+ #if support depends bugs fixed in bleedperl
+ return $ext =~ m:PerlIO/Scalar:;
+ }
+ 0;
+}
+
sub have_perl {
my $thing = shift;
#XXX: $thing could be a version
my $config;
- for my $key ($thing, "use$thing") {
- if (exists $Config{$key}) {
- $config = $key;
- return 1 if config_enabled($key);
+ my $have = \&{"have_perl_$thing"};
+ if (defined &$have) {
+ return 1 if $have->();
+ }
+ else {
+ for my $key ($thing, "use$thing") {
+ if (exists $Config{$key}) {
+ $config = $key;
+ return 1 if config_enabled($key);
+ }
}
}