You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by mm...@apache.org on 2013/01/05 02:45:15 UTC

svn commit: r1429187 - /spamassassin/trunk/t/rule_names.t

Author: mmartinec
Date: Sat Jan  5 01:45:15 2013
New Revision: 1429187

URL: http://svn.apache.org/viewvc?rev=1429187&view=rev
Log:
t/rule_names.t fix for "Parse errors: No plan found in TAP output"

Modified:
    spamassassin/trunk/t/rule_names.t

Modified: spamassassin/trunk/t/rule_names.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/rule_names.t?rev=1429187&r1=1429186&r2=1429187&view=diff
==============================================================================
--- spamassassin/trunk/t/rule_names.t (original)
+++ spamassassin/trunk/t/rule_names.t Sat Jan  5 01:45:15 2013
@@ -28,8 +28,11 @@ BEGIN {
 
 our $RUN_THIS_TEST;
 
+use Test;
 BEGIN {
   $RUN_THIS_TEST = conf_bool('run_rule_name_tests');
+
+  plan tests => 0  if !$RUN_THIS_TEST;
 };
 
 if (!$RUN_THIS_TEST) {
@@ -71,12 +74,11 @@ for my $test (@tests) {
   $anti_patterns{"$test,"} = "P_" . $i++;
 }
 
-use Test;
-{ # don't run this in a BEGIN phase, the %patterns and %anti_patterns
+{ # couldn't call Test::plan in a BEGIN phase, the %patterns and %anti_patterns
   # must be assembled first in order to get the planned test count
 
-  plan tests => (!$RUN_THIS_TEST ? 0 : 
-                  scalar(keys %anti_patterns) + scalar(keys %patterns)),
+  plan tests => scalar(keys %anti_patterns) + scalar(keys %patterns),
+
   onfail => sub {
       warn "\n\n   Note: rule_name failures may be only cosmetic" .
       "\n        but must be fixed before release\n\n";