From 3a281e31f4d0d92a7e50a9e4871aae03c36b34fd Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Thu, 12 May 2016 08:42:50 +0000 Subject: [PATCH] Privoxy-Regression-Test: Add a "Default level offset" directive ... which can be used to change the default level by a given value. This directive affects all tests located after it until the end of the file or a another "Default level offset" directive is reached. The purpose of this directive is to make it more convenient to skip similar tests in a given file without having to remove or disable the tests completely. --- tools/privoxy-regression-test.pl | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/privoxy-regression-test.pl b/tools/privoxy-regression-test.pl index 9a673198..b7484711 100755 --- a/tools/privoxy-regression-test.pl +++ b/tools/privoxy-regression-test.pl @@ -7,7 +7,7 @@ # A regression test "framework" for Privoxy. For documentation see: # perldoc privoxy-regression-test.pl # -# $Id: privoxy-regression-test.pl,v 1.93 2013/12/24 13:36:58 fabiankeil Exp $ +# $Id: privoxy-regression-test.pl,v 1.94 2016/05/08 10:45:18 fabiankeil Exp $ # # Wish list: # @@ -525,6 +525,7 @@ sub load_action_files ($) { my $curl_url = quote($actionfiles[$file_number]); my $actionfile = undef; my $sticky_actions = undef; + my $level_offset = 0; foreach (@{get_cgi_page_or_else($curl_url)}) { @@ -544,6 +545,11 @@ sub load_action_files ($) { next unless defined $token; # Load regression tests + if ($token eq 'default level offset') { + + $level_offset = $value; + l(LL_FILE_LOADING, "Setting default level offset to " . $level_offset); + } if (token_starts_new_test($token)) { @@ -552,6 +558,9 @@ sub load_action_files ($) { $count++; enlist_new_test(\@regression_tests, $token, $value, $si, $ri, $count); $no_checks = 1; # Already validated by enlist_new_test(). + if ($level_offset != 0) { + $regression_tests[$si][$ri]{'level'} += $level_offset; + } } if ($token =~ /level\s+(\d+)/i) { @@ -1948,6 +1957,13 @@ max-level value as failed tests will result in outgoing connections. Use the B<--max-level> option to run them as well. +The "Default level offset" directive can be used to change +the default level by a given value. This directive affects +all tests located after it until the end of the file or a another +"Default level offset" directive is reached. The purpose of this +directive is to make it more convenient to skip similar tests in +a given file without having to remove or disable the tests completely. + =head1 OPTIONS B<--debug bitmask> Add the bitmask provided as integer -- 2.39.2