X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=tools%2Fprivoxy-regression-test.pl;h=52e51175c0d8a28ce4fd2111c57fd0e66a4aef55;hp=7e654164c1ce0a11e1803e2abc4fd4c32b375f4b;hb=6cab1b67e518aac5177f81fae302242086a3a029;hpb=c8e6a2f5f13213881a02ebe937aa8b753a576bde diff --git a/tools/privoxy-regression-test.pl b/tools/privoxy-regression-test.pl index 7e654164..52e51175 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.91 2013/03/07 14:10:04 fabiankeil Exp $ +# $Id: privoxy-regression-test.pl,v 1.95 2016/05/12 08:42:50 fabiankeil Exp $ # # Wish list: # @@ -19,7 +19,7 @@ # - Document magic Expect Header values # - Internal fuzz support? # -# Copyright (c) 2007-2013 Fabian Keil +# Copyright (c) 2007-2016 Fabian Keil # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above @@ -341,7 +341,7 @@ sub load_regression_tests_through_privoxy () { $privoxy_features{$feature} = $1 if defined $feature; $feature = undef; - } elsif (m@This is Privoxy (\d+\.\d+\.\d+) on@) { + } elsif (m@This is Privoxy (\d+\.\d+\.\d+) on@) { $privoxy_version = $1; } } @@ -491,8 +491,7 @@ sub mark_matching_tests_for_skipping($) { my $message = sprintf("Marking test %s for ignoring. Overwrite condition: %s.", $regression_tests[$s][$r]{'number'}, $overwrite_condition); - # XXX: Should eventually be downgraded to LL_FILE_LOADING. - log_message($message); + l(LL_FILE_LOADING, $message); # XXX: Should eventually get its own key so get_skip_reason() # can tell about the overwrite condition. @@ -526,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)}) { @@ -545,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)) { @@ -553,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) { @@ -1949,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