# A regression test "framework" for Privoxy. For documentation see:
# perldoc privoxy-regression-test.pl
#
-# $Id: privoxy-regression-test.pl,v 1.159 2008/08/22 16:53:06 fk Exp $
+# $Id: privoxy-regression-test.pl,v 1.160 2008/10/25 15:39:27 fk Exp $
#
# Wish list:
#
our $privoxy_cgi_url;
our @privoxy_config;
+ our %privoxy_features;
my @actionfiles;
my $curl_url = '';
my $file_number = 0;
+ my $feature;
$curl_url .= $privoxy_cgi_url;
$curl_url .= 'show-status';
my $directive = $1 . " " . $2;
push (@privoxy_config, $directive);
+
+ } elsif (m@<td><code>([^<]*)</code></td>@) {
+
+ $feature = $1;
+
+ } elsif (m@<td> (Yes|No) </td>@) {
+
+ $privoxy_features{$feature} = $1 if defined $feature;
+ $feature = undef;
}
}
my $level = shift;
our %dependencies;
our @privoxy_config;
+ our %privoxy_features;
+
my $dependency_problem = 0;
if (defined ($dependencies{$level}{'config line'})) {
foreach (@privoxy_config) {
$dependency_problem = 0 if (/$dependency/);
+ last;
+ }
+
+ } elsif (defined ($dependencies{$level}{'feature status'})) {
+
+ my $dependency = $dependencies{$level}{'feature status'};
+ $dependency_problem = 1;
+ my ($feature, $status) = $dependency =~ /([^\s]*)\s+(Yes|No)/;
+
+ if (defined($privoxy_features{$feature})
+ and ($privoxy_features{$feature} eq $status))
+ {
+ $dependency_problem = 0;
}
}
if ($dependency =~ /config line\s+(.*)/) {
- $dependencies{$level}{'config line'} = $1;
+ $dependencies{$level}{'config line'} = $1;
+
+ } elsif ($dependency =~ /feature status\s+(.*)/) {
+
+ $dependencies{$level}{'feature status'} = $1;
+
}
}