stas 2003/04/23 19:47:34
Modified: perl-framework/Apache-Test/lib/Apache Test.pm
perl-framework/Apache-Test Changes
Log:
new Apache::Test function:
have_apache_version - to require a specific Apache version
Revision Changes Path
1.56 +31 -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.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- Test.pm 24 Apr 2003 01:49:15 -0000 1.55
+++ Test.pm 24 Apr 2003 02:47:33 -0000 1.56
@@ -13,8 +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_min_apache_version have_perl have_threads
- under_construction);
+ have_min_apache_version have_apache_version have_perl
+ have_threads under_construction);
$VERSION = '1.0';
%SubTests = ();
@@ -241,6 +241,22 @@
}
}
+sub have_apache_version {
+ my $wanted = shift;
+ my $cfg = Apache::Test::config();
+ (my $current) = $cfg->{server}->{version} =~ m:^Apache/(\d\.\d+\.\d+):;
+
+ if ($current ne $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';
@@ -484,9 +500,21 @@
Used to require a minimum version of Apache.
+For example:
+
plan tests => 5, have_min_apache_version("2.0.40");
-Requires Apache 2.0.40 or higher.
+requires Apache 2.0.40 or higher.
+
+=item have_apache_version
+
+Used to require a specific version of Apache.
+
+For example:
+
+ plan tests => 5, have_apache_version("2.0.40");
+
+requires Apache 2.0.40.
=item have_perl
1.7 +4 -2 httpd-test/perl-framework/Apache-Test/Changes
Index: Changes
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/Changes,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Changes 24 Apr 2003 01:49:15 -0000 1.6
+++ Changes 24 Apr 2003 02:47:34 -0000 1.7
@@ -8,8 +8,10 @@
=item 1.00
-new Apache::Test function: have_min_apache_version, to require a
-minimal Apache version. [Stas]
+new Apache::Test functions:
+have_min_apache_version - to require a minimal Apache version.
+have_apache_version - to require a specific Apache version.
+[Stas]
Apache::TestUtil API change:
write_perl_script => t_write_perl_script