stas 2003/04/23 18:49:15
Modified: perl-framework/Apache-Test/lib/Apache Test.pm
perl-framework/Apache-Test Changes
Log:
new Apache::Test function: have_min_apache_version, to require a
minimal Apache version.
Revision Changes Path
1.55 +30 -3 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.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- Test.pm 23 Apr 2003 03:29:56 -0000 1.54
+++ Test.pm 24 Apr 2003 01:49:15 -0000 1.55
@@ -13,7 +13,8 @@
@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_threads under_construction);
+ have_min_apache_version have_perl have_threads
+ under_construction);
$VERSION = '1.0';
%SubTests = ();
@@ -224,6 +225,22 @@
}
}
+sub have_min_apache_version {
+ my $wanted = shift;
+ my $cfg = Apache::Test::config();
+ (my $current) = $cfg->{server}->{version} =~ m:^Apache/(\d\.\d+\.\d+):;
+
+ if ($current lt $wanted) {
+ push @SkipReasons,
+ "apache version $wanted or higher is required," .
+ " this is version $current";
+ return 0;
+ }
+ else {
+ return 1;
+ }
+}
+
sub config_enabled {
my $key = shift;
defined $Config{$key} and $Config{$key} eq 'define';
@@ -455,11 +472,21 @@
plan tests => 5, have_apache 2;
-Requires httpd-2.x (apache-2.x).
+Requires Apache 2nd generation httpd-2.x.xx
plan tests => 5, have_apache 1;
-Requires apache-1.3.x.
+Requires Apache 1st generation (apache-1.3.xx)
+
+See also C<have_min_apache_version()>.
+
+=item have_min_apache_version
+
+Used to require a minimum version of Apache.
+
+ plan tests => 5, have_min_apache_version("2.0.40");
+
+Requires Apache 2.0.40 or higher.
=item have_perl
1.6 +3 -0 httpd-test/perl-framework/Apache-Test/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/Changes,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Changes 23 Apr 2003 03:17:08 -0000 1.5
+++ Changes 24 Apr 2003 01:49:15 -0000 1.6
@@ -8,6 +8,9 @@
=item 1.00
+new Apache::Test function: have_min_apache_version, to require a
+minimal Apache version. [Stas]
+
Apache::TestUtil API change:
write_perl_script => t_write_perl_script
write_shell_script => t_write_shell_script