# 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.162 2009/02/13 18:51:37 fk Exp $
#
# Wish list:
#
# - Document magic Expect Header values
# - Internal fuzz support?
#
-# Copyright (c) 2007-2008 Fabian Keil <fk@fabiankeil.de>
+# Copyright (c) 2007-2009 Fabian Keil <fk@fabiankeil.de>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
CLI_LOOPS => 1,
CLI_MAX_TIME => 5,
CLI_MIN_LEVEL => 0,
- CLI_MAX_LEVEL => 25,
+ # XXX: why limit at all.
+ CLI_MAX_LEVEL => 100,
CLI_FORKS => 0,
PRIVOXY_CGI_URL => 'http://p.p/',
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;
}
}
'Skipped ' . $skipped . '. ' .
$successes . " successes, " . $failures . " failures.");
- $all_tests += $tests;
- $all_failures += $failures;
+ $all_tests += $tests;
+ $all_failures += $failures;
$all_successes += $successes;
}
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; # XXX: this looks ... interesting.
+ }
+
+ } elsif (defined ($dependencies{$level}{'feature status'})) {
+
+ my $dependency = $dependencies{$level}{'feature status'};
+ my ($feature, $status) = $dependency =~ /([^\s]*)\s+(Yes|No)/;
+
+ $dependency_problem = 1;
+
+ 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;
+
}
}
$message = $time_stamp . ": " . $message;
}
-
printf(STDERR "%s\n", $message);
-
}
sub log_result ($$) {
}
sub print_version () {
- printf PRT_VERSION . "\n" . 'Copyright (C) 2007-2008 Fabian Keil <fk@fabiankeil.de>' . "\n";
+ printf PRT_VERSION . "\n" . 'Copyright (C) 2007-2009 Fabian Keil <fk@fabiankeil.de>' . "\n";
}
sub help () {