You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by km...@apache.org on 2018/02/05 09:10:14 UTC

svn commit: r1823142 [2/2] - in /spamassassin/branches/3.4: ./ t/

Modified: spamassassin/branches/3.4/t/rule_names.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/rule_names.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/rule_names.t (original)
+++ spamassassin/branches/3.4/t/rule_names.t Mon Feb  5 09:10:12 2018
@@ -28,17 +28,8 @@ 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) {
-  print "NOTE: this test requires 'run_rule_name_tests' set to 'y'.\n";
-  exit;
-}
+use Test::More;
+plan skip_all => "This test requires 'run_rule_name_tests' set to 'y'." unless conf_bool('run_rule_name_tests');
 
 use vars qw(%patterns %anti_patterns);
 
@@ -77,12 +68,9 @@ for my $test (@tests) {
 { # 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 => 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";
-  };
+  diag "Note: rule_name failures may be only cosmetic but must be fixed before release";
 };
 
 # ---------------------------------------------------------------------------

Modified: spamassassin/branches/3.4/t/rule_tests.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/rule_tests.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/rule_tests.t (original)
+++ spamassassin/branches/3.4/t/rule_tests.t Mon Feb  5 09:10:12 2018
@@ -15,15 +15,15 @@ if (-e 'test_dir') {            # runnin
   $prefix = '..';
 }
 
-use SATest; 
+use lib '.';
+use SATest;
 sa_t_init("rule_tests");
 
 use strict;
-use Test;
+use Test::More;
 use Mail::SpamAssassin;
-use vars qw($num_tests);
 
-$num_tests = 1;
+my $num_tests = 1;
 
 $Mail::SpamAssassin::Conf::COLLECT_REGRESSION_TESTS = 1;
 
@@ -160,7 +160,6 @@ foreach my $tests (@tests) {
     # debugging, what rule hits actually occurred
     #print $symbol, ": ", join(", ", keys(%rules_hit), "\n");
 
-    print "Test for '$symbol' (type: $test_type) against '$string'\n";
-    ok( (exists $rules_hit{$symbol} ? 1 : 0), ($ok_or_fail eq 'ok' ? 1 : 0), "Test for '$symbol' (type: $test_type) against '$string'" );
+    is( (exists $rules_hit{$symbol} ? 1 : 0), ($ok_or_fail eq 'ok' ? 1 : 0), "Test for '$symbol' (type: $test_type) against '$string'" );
 }
 

Modified: spamassassin/branches/3.4/t/rule_types.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/rule_types.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/rule_types.t (original)
+++ spamassassin/branches/3.4/t/rule_types.t Mon Feb  5 09:10:12 2018
@@ -2,7 +2,8 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("rule_types");
-use Test; BEGIN { plan tests => 9 };
+
+use Test::More tests => 9;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/sa_awl.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/sa_awl.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/sa_awl.t (original)
+++ spamassassin/branches/3.4/t/sa_awl.t Mon Feb  5 09:10:12 2018
@@ -2,7 +2,8 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("sa_awl");
-use Test; BEGIN { plan tests => 1 };
+
+use Test::More tests => 1;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/sa_check_spamd.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/sa_check_spamd.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/sa_check_spamd.t (original)
+++ spamassassin/branches/3.4/t/sa_check_spamd.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("sa-check_spamd");
-use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 7) };
 
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan tests => 7;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/sa_compile.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/sa_compile.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/sa_compile.t (original)
+++ spamassassin/branches/3.4/t/sa_compile.t Mon Feb  5 09:10:12 2018
@@ -3,7 +3,7 @@
 use lib '.'; use lib 't';
 $ENV{'TEST_PERL_TAINT'} = 'no';     # inhibit for this test
 use SATest; sa_t_init("sa_compile");
-use Test;
+
 use Config;
 use File::Basename;
 use File::Path qw/mkpath/;
@@ -26,21 +26,20 @@ sub re2c_version_new_enough {
   return $newenough;
 }
 
-use constant TEST_ENABLED => conf_bool('run_long_tests')
-                                && re2c_version_new_enough();
+use Test::More;
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan skip_all => "Tests don't work on windows" if $RUNNING_ON_WINDOWS;
+plan skip_all => "RE2C isn't new enough" unless re2c_version_new_enough();
+plan tests => 5;
 
-BEGIN { 
+BEGIN {
   if (-e 't/test_dir') {
     chdir 't';
   }
   if (-e 'test_dir') {
     unshift(@INC, '../blib/lib');
   }
-
-  plan tests => ((TEST_ENABLED && !$RUNNING_ON_WINDOWS) ? 5 : 0);
-};
-
-exit unless (TEST_ENABLED && !$RUNNING_ON_WINDOWS);
+}
 
 # -------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/sha1.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/sha1.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/sha1.t (original)
+++ spamassassin/branches/3.4/t/sha1.t Mon Feb  5 09:10:12 2018
@@ -16,7 +16,7 @@ if (-e 'test_dir') {            # runnin
 }
 
 use strict;
-use Test;
+
 use Mail::SpamAssassin;
 
 BEGIN {
@@ -24,7 +24,7 @@ BEGIN {
   or do { require Digest::SHA1; import Digest::SHA1 qw(sha1_hex) }
 }
 
-plan tests => 15;
+use Test::More tests => 15;
 
 sub try {
   my ($data, $want) = @_;

Modified: spamassassin/branches/3.4/t/shortcircuit.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/shortcircuit.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/shortcircuit.t (original)
+++ spamassassin/branches/3.4/t/shortcircuit.t Mon Feb  5 09:10:12 2018
@@ -2,7 +2,8 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("shortcircuit");
-use Test; BEGIN { plan tests => 18 };
+
+use Test::More tests => 18;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spam.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spam.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spam.t (original)
+++ spamassassin/branches/3.4/t/spam.t Mon Feb  5 09:10:12 2018
@@ -2,7 +2,8 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spam");
-use Test; BEGIN { plan tests => 7 };
+
+use Test::More tests => 7;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamc.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc.t (original)
+++ spamassassin/branches/3.4/t/spamc.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,11 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamc");
-use Test; plan tests => ($NO_SPAMC_EXE ? 0 : 2);
 
-exit if $NO_SPAMC_EXE;
+use Test::More;
+plan skip_all => "No SPAMC exe" if $SKIP_SPAMC_TESTS;
+plan tests => 2;
+
 # ---------------------------------------------------------------------------
 
 %patterns = (

Modified: spamassassin/branches/3.4/t/spamc_B.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc_B.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc_B.t (original)
+++ spamassassin/branches/3.4/t/spamc_B.t Mon Feb  5 09:10:12 2018
@@ -3,9 +3,10 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamc_B");
 
-use Test; plan tests => ($SKIP_SPAMC_TESTS ? 0 : 9);
+use Test::More;
+plan skip_all => "No SPAMC exe" if $SKIP_SPAMC_TESTS;
+plan tests => 9;
 
-exit if $SKIP_SPAMC_TESTS;
 # ---------------------------------------------------------------------------
 
 %patterns = (

Modified: spamassassin/branches/3.4/t/spamc_E.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc_E.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc_E.t (original)
+++ spamassassin/branches/3.4/t/spamc_E.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamc_E");
-use Test; plan tests => ($SKIP_SPAMC_TESTS ? 0 : 2);
 
-exit if $SKIP_SPAMC_TESTS;
+use Test::More;
+plan skip_all => "No SPAMC exe" if $SKIP_SPAMC_TESTS;
+plan tests => 2;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamc_H.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc_H.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc_H.t (original)
+++ spamassassin/branches/3.4/t/spamc_H.t Mon Feb  5 09:10:12 2018
@@ -3,14 +3,11 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamc_H");
 
-# only run for localhost!
-our $DO_RUN = conf_bool('run_net_tests')
-                    && !$SKIP_SPAMD_TESTS
-                    && ($spamdhost eq '127.0.0.1');
-
-use Test; plan tests => ($DO_RUN ? 5 : 0);
-
-exit unless $DO_RUN;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan skip_all => "Net tests disabled" unless conf_bool('run_net_tests');
+plan skip_all => "Spam host is not loopback" if $spamdhost ne '127.0.0.1';
+plan tests => 5;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamc_bug6176.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc_bug6176.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc_bug6176.t (original)
+++ spamassassin/branches/3.4/t/spamc_bug6176.t Mon Feb  5 09:10:12 2018
@@ -4,9 +4,11 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamc_bug6176");
-use Test; plan tests => ($NO_SPAMC_EXE ? 0 : 2);
 
-exit if $NO_SPAMC_EXE;
+use Test::More;
+plan skip_all => "No SPAMC exe" if $SKIP_SPAMC_TESTS;
+plan tests => 2;
+
 # ---------------------------------------------------------------------------
 
 %patterns = (

Modified: spamassassin/branches/3.4/t/spamc_c.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc_c.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc_c.t (original)
+++ spamassassin/branches/3.4/t/spamc_c.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamc_c");
-use Test; plan tests => ($SKIP_SPAMC_TESTS ? 0 : 2);
 
-exit if $SKIP_SPAMC_TESTS;
+use Test::More;
+plan skip_all => "No SPAMC exe" if $SKIP_SPAMC_TESTS;
+plan tests => 2;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamc_c_stdout_closed.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc_c_stdout_closed.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc_c_stdout_closed.t (original)
+++ spamassassin/branches/3.4/t/spamc_c_stdout_closed.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamc_c_stdout_closed");
-use Test; plan tests => ($SKIP_SPAMC_TESTS ? 0 : 2);
 
-exit if $SKIP_SPAMC_TESTS;
+use Test::More;
+plan skip_all => "No SPAMC exe" if $SKIP_SPAMC_TESTS;
+plan tests => 2;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamc_cf.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc_cf.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc_cf.t (original)
+++ spamassassin/branches/3.4/t/spamc_cf.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamc_cf");
-use Test; plan tests => ($SKIP_SPAMC_TESTS ? 0 : 4);
 
-exit if $SKIP_SPAMC_TESTS;
+use Test::More;
+plan skip_all => "No SPAMC exe" if $SKIP_SPAMC_TESTS;
+plan tests => 4;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamc_headers.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc_headers.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc_headers.t (original)
+++ spamassassin/branches/3.4/t/spamc_headers.t Mon Feb  5 09:10:12 2018
@@ -3,8 +3,9 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamc_headers");
 
-use Test; plan tests => ($SKIP_SPAMC_TESTS ? 0 : 5);
-exit if $NO_SPAMC_EXE;
+use Test::More;
+plan skip_all => "No SPAMC exe" if $SKIP_SPAMC_TESTS;
+plan tests => 5;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamc_l.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc_l.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc_l.t (original)
+++ spamassassin/branches/3.4/t/spamc_l.t Mon Feb  5 09:10:12 2018
@@ -2,11 +2,12 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamc_l");
-use Test; plan tests => ($NO_SPAMC_EXE ? 0 : 4),
-               onfail => sub { warn "FAIL: Some other process running on port 8?  Test assumes nothing is listening on port 8." };
 
+use Test::More;
+plan skip_all => "No SPAMC exe" if $NO_SPAMC_EXE;
+plan tests => 4;
 
-exit if $NO_SPAMC_EXE;
+diag("NOTE: Failure might be because some other process is running on port 8.  Test assumes nothing is listening on port 8.");
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamc_optC.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc_optC.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc_optC.t (original)
+++ spamassassin/branches/3.4/t/spamc_optC.t Mon Feb  5 09:10:12 2018
@@ -3,9 +3,9 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamc_optC");
 
-use Test; plan tests => $SKIP_SPAMC_TESTS ? 0 : 9;
-
-exit if $SKIP_SPAMC_TESTS;
+use Test::More;
+plan skip_all => "No SPAMC exe" if $SKIP_SPAMC_TESTS;
+plan tests => 9;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamc_optL.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc_optL.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc_optL.t (original)
+++ spamassassin/branches/3.4/t/spamc_optL.t Mon Feb  5 09:10:12 2018
@@ -4,9 +4,10 @@ use lib '.'; use lib 't';
 use SATest; sa_t_init("spamc_optL");
 use constant HAS_SDBM_FILE => eval { require SDBM_File; };
 
-use Test; plan tests => (!HAS_SDBM_FILE || $SKIP_SPAMC_TESTS ? 0 : 16);
-
-exit if (!HAS_SDBM_FILE || $SKIP_SPAMC_TESTS);
+use Test::More;
+plan skip_all => "No SPAMC exe" if $SKIP_SPAMC_TESTS;
+plan skip_all => "No SDBM_File" unless HAS_SDBM_FILE;
+plan tests => 16;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamc_x_E_R.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc_x_E_R.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc_x_E_R.t (original)
+++ spamassassin/branches/3.4/t/spamc_x_E_R.t Mon Feb  5 09:10:12 2018
@@ -3,11 +3,10 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamc_x_E_R");
 
-use constant TEST_ENABLED => conf_bool('run_long_tests');
-our $DO_RUN = !$SKIP_SPAMD_TESTS && TEST_ENABLED;
-
-use Test; plan tests => ($DO_RUN ? 49 : 0);
-exit unless $DO_RUN;
+use Test::More;
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan tests => 49;
 
 # ---------------------------------------------------------------------------
 # test case for bug 5412; exit status with -x/-E/-R combos

Modified: spamassassin/branches/3.4/t/spamc_x_e.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc_x_e.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc_x_e.t (original)
+++ spamassassin/branches/3.4/t/spamc_x_e.t Mon Feb  5 09:10:12 2018
@@ -3,12 +3,10 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamc_x_e");
 
-our $DO_RUN = !$SKIP_SPAMD_TESTS;
-
-use Test; plan tests => ($DO_RUN ? 7 : 0);
-
-exit unless $DO_RUN;
-
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan tests => 7;
+diag "Failure may indicate some other process running on port 8.  Test assumes nothing is listening on port 8.";
 # ---------------------------------------------------------------------------
 # test case for bug 5478: spamc -x -e
 

Modified: spamassassin/branches/3.4/t/spamc_y.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc_y.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc_y.t (original)
+++ spamassassin/branches/3.4/t/spamc_y.t Mon Feb  5 09:10:12 2018
@@ -2,11 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamc_y");
-use Test; plan tests => ($NO_SPAMC_EXE ? 0 : 2),
-               onfail => sub { warn "FAIL: Some other process running on port 8?  Test assumes nothing is listening on port 8." };
 
-
-exit if $NO_SPAMC_EXE;
+use Test::More;
+plan skip_all => "No SPAMC exe" if $NO_SPAMC_EXE;
+plan tests => 2;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamc_z.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamc_z.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamc_z.t (original)
+++ spamassassin/branches/3.4/t/spamc_z.t Mon Feb  5 09:10:12 2018
@@ -8,9 +8,11 @@ use SATest; sa_t_init("spamc_z");
 system("$spamc -z < /dev/null");
 my $SPAMC_Z_AVAILABLE = ($? >> 8 == 0);
 
-use Test;
-plan tests => (($SKIP_SPAMD_TESTS || !HAVE_ZLIB || !$SPAMC_Z_AVAILABLE) ? 0 : 9);
-exit if ($SKIP_SPAMD_TESTS || !HAVE_ZLIB || !$SPAMC_Z_AVAILABLE);
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan skip_all => "ZLIB REQUIRED" unless HAVE_ZLIB;
+plan skip_all => "SPAMC Z unavailable" unless $SPAMC_Z_AVAILABLE;
+plan tests => 9;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd.t (original)
+++ spamassassin/branches/3.4/t/spamd.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd");
-use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 14) };
 
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan tests => 14;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_allow_user_rules.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_allow_user_rules.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_allow_user_rules.t (original)
+++ spamassassin/branches/3.4/t/spamd_allow_user_rules.t Mon Feb  5 09:10:12 2018
@@ -2,15 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_allow_user_rules");
-use Test;
 
-BEGIN { 
-
-  plan tests => ($SKIP_SPAMD_TESTS ? 0 : 5)
-
-};
-
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan tests => 5;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_client.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_client.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_client.t (original)
+++ spamassassin/branches/3.4/t/spamd_client.t Mon Feb  5 09:10:12 2018
@@ -19,11 +19,13 @@ if (-e 'test_dir') {            # runnin
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_client");
 
-use constant TEST_ENABLED => conf_bool('run_long_tests');
 use constant HAS_SDBM_FILE => eval { require SDBM_File; };
 
-our $DO_RUN = !$SKIP_SPAMD_TESTS && TEST_ENABLED;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
 
+# TODO: These should be skips down in the code, not changing the test count.
 my $num_tests = 18;
 
 # UNIX socket tests
@@ -36,9 +38,7 @@ if (HAS_SDBM_FILE) {
   $num_tests += 21;
 }
 
-use Test; plan tests => ($DO_RUN ? $num_tests : 0);
-
-exit unless $DO_RUN;
+plan tests => $num_tests;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_hup.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_hup.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_hup.t (original)
+++ spamassassin/branches/3.4/t/spamd_hup.t Mon Feb  5 09:10:12 2018
@@ -4,11 +4,11 @@ use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_hup");
 use File::Spec;
 
-use constant TEST_ENABLED => conf_bool('run_long_tests') &&
-                                !$SKIP_SPAMD_TESTS && !$RUNNING_ON_WINDOWS;
-
-use Test; BEGIN { plan tests => (TEST_ENABLED ? 110 : 0) };
-exit unless TEST_ENABLED;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan skip_all => "Tests don't work on windows" if $RUNNING_ON_WINDOWS;
+plan tests => 110;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_kill_restart.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_kill_restart.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_kill_restart.t (original)
+++ spamassassin/branches/3.4/t/spamd_kill_restart.t Mon Feb  5 09:10:12 2018
@@ -3,15 +3,14 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_kill_restart");
 
-use constant TEST_ENABLED => conf_bool('run_long_tests') &&
-                                !$SKIP_SPAMD_TESTS && !$RUNNING_ON_WINDOWS;
-
-use Test; BEGIN { plan tests => (TEST_ENABLED? 93 : 0) };
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan skip_all => "Tests don't work on windows" if $RUNNING_ON_WINDOWS;
+plan tests => 93;
 
 use File::Spec;
 
-exit unless TEST_ENABLED;
-
 # ---------------------------------------------------------------------------
 
 my $pid_file = "log/spamd.pid";

Modified: spamassassin/branches/3.4/t/spamd_kill_restart_rr.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_kill_restart_rr.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_kill_restart_rr.t (original)
+++ spamassassin/branches/3.4/t/spamd_kill_restart_rr.t Mon Feb  5 09:10:12 2018
@@ -3,15 +3,14 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_kill_restart_rr");
 
-use constant TEST_ENABLED => conf_bool('run_long_tests') &&
-                                !$SKIP_SPAMD_TESTS && !$RUNNING_ON_WINDOWS;
-
-use Test; BEGIN { plan tests => (TEST_ENABLED? 93 : 0) };
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan skip_all => "Tests don't work on windows" if $RUNNING_ON_WINDOWS;
+plan tests => 93;
 
 use File::Spec;
 
-exit unless TEST_ENABLED;
-
 # ---------------------------------------------------------------------------
 
 my $pid_file = "log/spamd.pid";

Modified: spamassassin/branches/3.4/t/spamd_ldap.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_ldap.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_ldap.t (original)
+++ spamassassin/branches/3.4/t/spamd_ldap.t Mon Feb  5 09:10:12 2018
@@ -5,11 +5,9 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_ldap");
 
-use constant TEST_ENABLED => (-e 't/do_ldap' || -e 'do_ldap');
-
-use Test; BEGIN { plan tests => (TEST_ENABLED ? 8 : 0) };
-
-exit unless (TEST_ENABLED);
+use Test::More;
+plan skip_all => "LDAP tests disabled" unless (-e 't/do_ldap' || -e 'do_ldap');
+plan tests => 8;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_maxchildren.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_maxchildren.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_maxchildren.t (original)
+++ spamassassin/branches/3.4/t/spamd_maxchildren.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_maxchildren");
-use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 22) };
 
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan tests => 22;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_maxsize.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_maxsize.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_maxsize.t (original)
+++ spamassassin/branches/3.4/t/spamd_maxsize.t Mon Feb  5 09:10:12 2018
@@ -5,9 +5,9 @@ use SATest; sa_t_init("spamd_maxsize");
 
 # this test was disabled, probably due to Bug 5731; re-enabling it for SA 3.4.0
 # (was: TODO JMD remove once DB_File bug is fixed)
-use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 1) };
-
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan tests => 1;
 
 # ---------------------------------------------------------------------------
 # test for size limit issues like in Bug 5412

Modified: spamassassin/branches/3.4/t/spamd_parallel.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_parallel.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_parallel.t (original)
+++ spamassassin/branches/3.4/t/spamd_parallel.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_parallel");
-use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 20) };
 
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan tests => 20;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_plugin.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_plugin.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_plugin.t (original)
+++ spamassassin/branches/3.4/t/spamd_plugin.t Mon Feb  5 09:10:12 2018
@@ -3,11 +3,11 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_plugin");
 
-use constant numtests => 6;
-use Test; plan tests => (($SKIP_SPAMD_TESTS || $RUNNING_ON_WINDOWS || $SKIP_SETUID_NOBODY_TESTS) ?
-                        0 : numtests);
-
-exit unless !($SKIP_SPAMD_TESTS || $RUNNING_ON_WINDOWS || $SKIP_SETUID_NOBODY_TESTS);
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan skip_all => "Tests don't work on windows" if $RUNNING_ON_WINDOWS;
+plan skip_all => "UID nobody tests" if $SKIP_SETUID_NOBODY_TESTS;
+plan tests => 6;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_port.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_port.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_port.t (original)
+++ spamassassin/branches/3.4/t/spamd_port.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_port");
-use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 4) };
 
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan tests => 4;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_prefork_stress.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_prefork_stress.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_prefork_stress.t (original)
+++ spamassassin/branches/3.4/t/spamd_prefork_stress.t Mon Feb  5 09:10:12 2018
@@ -5,28 +5,24 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_prefork_stress");
-use Test;
 
-use constant TEST_ENABLED => conf_bool('run_long_tests');
-our $RUN_THIS_TEST;
+use Test::More;
 
-my $pgrep;
-my $pkill;
+
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan skip_all => "Spamd prefork stress tests disabled" unless conf_bool('run_spamd_prefork_stress_test');
 
 # require pkill and pgrep be installed to run this test
-BEGIN {
-  $RUN_THIS_TEST = conf_bool('run_spamd_prefork_stress_test') && TEST_ENABLED;
-  $pkill = locate_command("pkill");
-  $pgrep = locate_command("pgrep");
-  $RUN_THIS_TEST = 0 if !$pkill || !$pgrep;
-  plan tests => ($SKIP_SPAMD_TESTS || !$RUN_THIS_TEST ? 0 : 14) 
-};
-
-exit if $SKIP_SPAMD_TESTS;
-
-print "NOTE: this test requires /usr/bin/pkill, /usr/bin/pgrep, and both\n".
-    "'run_spamd_prefork_stress_test' and 'run_long_tests' set to 'y'.\n";
-exit unless $RUN_THIS_TEST;
+my $pkill = locate_command("pkill");
+my $pgrep = locate_command("pgrep");
+
+my $note = "NOTE: this test requires /usr/bin/pkill, /usr/bin/pgrep, and both\n".
+           "'run_spamd_prefork_stress_test' and 'run_long_tests' set to 'y'.\n";
+
+plan skip_all => "No pkill available - $note" unless $pkill;
+plan skip_all => "No pgrep available - $note" unless $pgrep;
+plan tests => 14;
 
 system($pgrep, "spamd child");
 if ($? >> 8 == 0) {

Modified: spamassassin/branches/3.4/t/spamd_prefork_stress_2.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_prefork_stress_2.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_prefork_stress_2.t (original)
+++ spamassassin/branches/3.4/t/spamd_prefork_stress_2.t Mon Feb  5 09:10:12 2018
@@ -5,28 +5,22 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_prefork_stress_2");
-use Test;
+use Test::More;
 
-use constant TEST_ENABLED => conf_bool('run_long_tests');
-our $RUN_THIS_TEST;
-
-my $pgrep;
-my $pkill;
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan skip_all => "Spamd prefork stress tests disabled" unless conf_bool('run_spamd_prefork_stress_test');
 
 # require pkill and pgrep be installed to run this test
-BEGIN {
-  $RUN_THIS_TEST = conf_bool('run_spamd_prefork_stress_test') && TEST_ENABLED;
-  $pkill = locate_command("pkill");
-  $pgrep = locate_command("pgrep");
-  $RUN_THIS_TEST = 0 if !$pkill || !$pgrep;
-  plan tests => ($SKIP_SPAMD_TESTS || !$RUN_THIS_TEST ? 0 : 14)
-};
-
-exit if $SKIP_SPAMD_TESTS;
-
-print "NOTE: this test requires /usr/bin/pkill, /usr/bin/pgrep, and both\n".
-    "'run_spamd_prefork_stress_test' and 'run_long_tests' set to 'y'.\n";
-exit unless $RUN_THIS_TEST;
+my $note = "NOTE: this test requires /usr/bin/pkill, /usr/bin/pgrep, and both\n".
+           "'run_spamd_prefork_stress_test' and 'run_long_tests' set to 'y'.\n";
+
+my $pkill = locate_command("pkill");
+my $pgrep = locate_command("pgrep");
+plan skip_all => "No pkill available - $note" unless $pkill;
+plan skip_all => "No pgrep available - $note" unless $pgrep;
+
+plan tests => 14;
 
 system($pgrep, "spamd child");
 if ($? >> 8 == 0) {

Modified: spamassassin/branches/3.4/t/spamd_prefork_stress_3.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_prefork_stress_3.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_prefork_stress_3.t (original)
+++ spamassassin/branches/3.4/t/spamd_prefork_stress_3.t Mon Feb  5 09:10:12 2018
@@ -2,19 +2,14 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_prefork_stress_3");
-use Test;
 
-our $RUN_THIS_TEST;
-BEGIN {
-  $RUN_THIS_TEST = conf_bool('run_spamd_prefork_stress_test') &&
-                        conf_bool('run_long_tests');
-  plan tests => ($SKIP_SPAMD_TESTS || !$RUN_THIS_TEST ? 0 : 291)
-};
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+diag("NOTE: this test requires both 'run_spamd_prefork_stress_test' and 'run_long_tests' set to 'y'.");
 
-print "NOTE: this test requires both 'run_spamd_prefork_stress_test'\n".
-    "and 'run_long_tests' set to 'y'.\n";
-exit unless $RUN_THIS_TEST;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan skip_all => "Spamd prefork stress tests disabled" unless conf_bool('run_spamd_prefork_stress_test');
+plan tests => 291;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_prefork_stress_4.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_prefork_stress_4.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_prefork_stress_4.t (original)
+++ spamassassin/branches/3.4/t/spamd_prefork_stress_4.t Mon Feb  5 09:10:12 2018
@@ -2,19 +2,13 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_prefork_stress_4");
-use Test;
 
-our $RUN_THIS_TEST;
-BEGIN {
-  $RUN_THIS_TEST = conf_bool('run_spamd_prefork_stress_test') &&
-                        conf_bool('run_long_tests');
-  plan tests => ($SKIP_SPAMD_TESTS || !$RUN_THIS_TEST ? 0 : 43)
-};
-exit if $SKIP_SPAMD_TESTS;
-
-print "NOTE: this test requires both 'run_spamd_prefork_stress_test'\n".
-    "and 'run_long_tests' set to 'y'.\n";
-exit unless $RUN_THIS_TEST;
+use Test::More;
+diag("NOTE: this test requires both 'run_spamd_prefork_stress_test' and 'run_long_tests' set to 'y'.");
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan skip_all => "Spamd prefork stress tests disabled" unless conf_bool('run_spamd_prefork_stress_test');
+plan tests => 43;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_protocol_10.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_protocol_10.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_protocol_10.t (original)
+++ spamassassin/branches/3.4/t/spamd_protocol_10.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_protocol_10");
-use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 10) };
 
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan tests => 10;
 
 use File::Path;
 use IO::Socket;

Modified: spamassassin/branches/3.4/t/spamd_report.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_report.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_report.t (original)
+++ spamassassin/branches/3.4/t/spamd_report.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_report");
-use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 6) };
 
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan tests => 6;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_report_ifspam.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_report_ifspam.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_report_ifspam.t (original)
+++ spamassassin/branches/3.4/t/spamd_report_ifspam.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_report_ifspam");
-use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 10) };
 
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan tests => 10;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_sql_prefs.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_sql_prefs.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_sql_prefs.t (original)
+++ spamassassin/branches/3.4/t/spamd_sql_prefs.t Mon Feb  5 09:10:12 2018
@@ -5,12 +5,12 @@ use SATest; sa_t_init("spamd_sql_prefs")
 use constant HAS_DBI => eval { require DBI; };
 use constant HAS_DBD_SQLITE => eval { require DBD::SQLite; };
 
-our $DO_RUN = !$SKIP_SPAMD_TESTS && conf_bool('run_sql_pref_tests')
-    && HAS_DBI && HAS_DBD_SQLITE;
-
-use Test; plan tests => ($DO_RUN ? 32 : 0);
-
-exit unless $DO_RUN;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan skip_all => "SQL Pref tests disabled" unless conf_bool('run_sql_pref_tests');
+plan skip_all => "DBI is unavailble" unless HAS_DBI;
+plan skip_all => "SQLite is unavailble" unless HAS_DBD_SQLITE;
+plan tests => 32;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_ssl.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_ssl.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_ssl.t (original)
+++ spamassassin/branches/3.4/t/spamd_ssl.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,11 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_ssl");
-use Test; plan tests => (($SKIP_SPAMD_TESTS || !$SSL_AVAILABLE) ? 0 : 9);
 
-exit if ($SKIP_SPAMD_TESTS || !$SSL_AVAILABLE);
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan skip_all => "SSL is unavailble" unless $SSL_AVAILABLE;
+plan tests => 9;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_ssl_accept_fail.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_ssl_accept_fail.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_ssl_accept_fail.t (original)
+++ spamassassin/branches/3.4/t/spamd_ssl_accept_fail.t Mon Feb  5 09:10:12 2018
@@ -3,9 +3,11 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_ssl_accept_fail");
-use Test; plan tests => (($SKIP_SPAMD_TESTS || !$SSL_AVAILABLE) ? 0 : 12);
 
-exit if ($SKIP_SPAMD_TESTS || !$SSL_AVAILABLE);
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan skip_all => "SSL is unavailble" unless $SSL_AVAILABLE;
+plan tests => 12;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_stop.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_stop.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_stop.t (original)
+++ spamassassin/branches/3.4/t/spamd_stop.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_stop");
-use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 2) };
 
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan tests => 2;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_symbols.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_symbols.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_symbols.t (original)
+++ spamassassin/branches/3.4/t/spamd_symbols.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_symbols");
-use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 3) };
 
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan tests => 3;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_syslog.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_syslog.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_syslog.t (original)
+++ spamassassin/branches/3.4/t/spamd_syslog.t Mon Feb  5 09:10:12 2018
@@ -2,9 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_syslog");
-use Test; BEGIN { plan tests => ($SKIP_SPAMD_TESTS ? 0 : 7) };
 
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+plan tests => 7;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_unix.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_unix.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_unix.t (original)
+++ spamassassin/branches/3.4/t/spamd_unix.t Mon Feb  5 09:10:12 2018
@@ -3,9 +3,10 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_unix");
 
-use Test; BEGIN { plan tests => ((!$SKIP_SPAMD_TESTS && !$RUNNING_ON_WINDOWS)? 4 : 0) };
-
-exit unless (!$SKIP_SPAMD_TESTS && !$RUNNING_ON_WINDOWS);
+use Test::More;
+plan skip_all => "Spamd tests disabled"        if $SKIP_SPAMD_TESTS;
+plan skip_all => "Tests don't work on windows" if $RUNNING_ON_WINDOWS;
+plan tests => 4;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_unix_and_tcp.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_unix_and_tcp.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_unix_and_tcp.t (original)
+++ spamassassin/branches/3.4/t/spamd_unix_and_tcp.t Mon Feb  5 09:10:12 2018
@@ -3,9 +3,10 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_unix_and_tcp");
 
-use Test; BEGIN { plan tests => ((!$SKIP_SPAMD_TESTS && !$RUNNING_ON_WINDOWS)? 10 : 0) };
-
-exit unless (!$SKIP_SPAMD_TESTS && !$RUNNING_ON_WINDOWS);
+use Test::More;
+plan skip_all => "Spamd tests disabled"        if $SKIP_SPAMD_TESTS;
+plan skip_all => "Tests don't work on windows" if $RUNNING_ON_WINDOWS;
+plan tests => 10;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/spamd_user_rules_leak.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_user_rules_leak.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_user_rules_leak.t (original)
+++ spamassassin/branches/3.4/t/spamd_user_rules_leak.t Mon Feb  5 09:10:12 2018
@@ -3,13 +3,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_user_rules_leak");
-use Test;
-BEGIN { 
 
-  plan tests => ($SKIP_SPAMD_TESTS ? 0 : 28)
-
-};
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+plan skip_all => 'Spamd tests disabled' if $SKIP_SPAMD_TESTS;
+plan tests => 28;
 
 # ---------------------------------------------------------------------------
 # If user A defines a user rule (when allow_user_rules is enabled) it affects

Modified: spamassassin/branches/3.4/t/spamd_utf8.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_utf8.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_utf8.t (original)
+++ spamassassin/branches/3.4/t/spamd_utf8.t Mon Feb  5 09:10:12 2018
@@ -2,10 +2,12 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_utf8");
-my $am_running;
+
 my $testlocale;
 
-use Test; BEGIN {
+use Test::More;
+
+BEGIN {
   $testlocale = 'en_US.UTF-8';
 
   my $havelocale = 1;
@@ -15,11 +17,12 @@ use Test; BEGIN {
   }
   close IN;
 
-  $am_running = (!$SKIP_SPAMD_TESTS && $havelocale);
-  plan tests => ($am_running ? 3 : 0);
+  plan skip_all => "Spamd tests disabled" if $SKIP_SPAMD_TESTS;
+  plan skip_all => "No locale?"           unless $havelocale;
+
+  plan tests => 3;
 };
 
-exit unless $am_running;
 $ENV{'LANG'} = $testlocale;
 
 # ---------------------------------------------------------------------------

Modified: spamassassin/branches/3.4/t/spamd_whitelist_leak.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spamd_whitelist_leak.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spamd_whitelist_leak.t (original)
+++ spamassassin/branches/3.4/t/spamd_whitelist_leak.t Mon Feb  5 09:10:12 2018
@@ -3,13 +3,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spamd_whitelist_leak");
-use Test;
-BEGIN { 
 
-  plan tests => ($SKIP_SPAMD_TESTS ? 0 : 8)
-
-};
-exit if $SKIP_SPAMD_TESTS;
+use Test::More;
+plan skip_all => 'Spamd tests disabled.' if $SKIP_SPAMD_TESTS;
+plan tests => 8;
 
 # ---------------------------------------------------------------------------
 # bug 6003

Modified: spamassassin/branches/3.4/t/spf.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/spf.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/spf.t (original)
+++ spamassassin/branches/3.4/t/spf.t Mon Feb  5 09:10:12 2018
@@ -2,34 +2,35 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("spf");
-use Test;
+use Test::More;
 
-use constant TEST_ENABLED => conf_bool('run_long_tests') && conf_bool('run_net_tests');
 use constant HAS_SPFQUERY => eval { require Mail::SPF::Query; };
 use constant HAS_MAILSPF => eval { require Mail::SPF; };
+
 # bug 3806:
 # Do not run this test with version of Sys::Hostname::Long older than 1.4
 # on non-Linux unices as root, due to a bug in Sys::Hostname::Long
 # (it is used by Mail::SPF::Query, which is now obsoleted by Mail::SPF)
 use constant IS_LINUX   => $^O eq 'linux';
-use constant IS_WINDOWS => ($^O =~ /^(mswin|dos|os2)/oi);
+use constant IS_WINDOWS => ($^O =~ /^(mswin|dos|os2)/i);
 use constant AM_ROOT    => $< == 0;
 
 use constant HAS_UNSAFE_HOSTNAME =>  # Bug 3806 - module exists and is old
   eval { require Sys::Hostname::Long && Sys::Hostname::Long->VERSION < 1.4 };
 
-use constant DO_RUN =>
-  TEST_ENABLED && (HAS_SPFQUERY || HAS_MAILSPF) &&
-  (!HAS_UNSAFE_HOSTNAME || !AM_ROOT || IS_LINUX || IS_WINDOWS);
-
-BEGIN {
-
-  # some tests are run once for each SPF module, others are only run once
-  plan tests => (DO_RUN ? (HAS_SPFQUERY && HAS_MAILSPF ? 106 : (HAS_SPFQUERY ? 58 : 58)) : 0);
-
-};
-
-exit unless (DO_RUN);
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan skip_all => "Net tests disabled" unless conf_bool('run_net_tests');
+plan skip_all => "Need Mail::SPF or Mail::SPF::Query" unless (HAS_SPFQUERY || HAS_MAILSPF);
+plan skip_all => "root required" unless AM_ROOT;
+plan skip_all => "Sys::Hostname::Long > 1.4 required." if HAS_UNSAFE_HOSTNAME;
+plan skip_all => "Test only designed for Windows or Linux" unless (IS_LINUX || IS_WINDOWS);
+
+if(HAS_SPFQUERY && HAS_MAILSPF) {
+  plan tests => 106;
+}
+else {
+  plan tests => 58; # TODO: These should be skips down in the code, not changing the test count.
+}
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/sql_based_whitelist.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/sql_based_whitelist.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/sql_based_whitelist.t (original)
+++ spamassassin/branches/3.4/t/sql_based_whitelist.t Mon Feb  5 09:10:12 2018
@@ -3,17 +3,10 @@
 use lib '.'; use lib 't';
 use SATest;
 
-use constant TEST_ENABLED => conf_bool('run_awl_sql_tests');
-
-use Test;
-
-BEGIN { plan tests => (TEST_ENABLED ? 11 : 0),
-        onfail => sub {
-            warn "\n\nNote: Failure may be due to an incorrect config";
-        }
-    };
-
-exit unless TEST_ENABLED;
+use Test::More;
+plan skip_all => 'AWL SQL Tests not enabled.' if conf_bool('run_awl_sql_tests');
+plan tests => 11;
+diag "Note: Failure may be due to an incorrect config";
 
 sa_t_init("sql_based_whitelist");
 

Modified: spamassassin/branches/3.4/t/stop_always_matching_regexps.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/stop_always_matching_regexps.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/stop_always_matching_regexps.t (original)
+++ spamassassin/branches/3.4/t/stop_always_matching_regexps.t Mon Feb  5 09:10:12 2018
@@ -13,7 +13,7 @@ BEGIN {
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("stop_always_matching_regexps");
-use Test; BEGIN { plan tests => 13 };
+use Test::More tests => 13;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/strip2.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/strip2.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/strip2.t (original)
+++ spamassassin/branches/3.4/t/strip2.t Mon Feb  5 09:10:12 2018
@@ -2,12 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("strip2");
-use Test;
 
-use constant TEST_ENABLED => conf_bool('run_long_tests');
-
-BEGIN { plan tests => TEST_ENABLED ? 98 : 0 };
-exit unless TEST_ENABLED;
+use Test::More;
+plan skip_all => 'Long running tests disabled' if conf_bool('run_long_tests');
+plan tests => 98;
 
 # ---------------------------------------------------------------------------
 
@@ -37,7 +35,8 @@ foreach $input (@files) {
 	");
 
   # create report_safe 0 output
-  my $d_input = "log/d.$testname/${Test::ntest}";
+  my $test_number = test_number();
+  my $d_input = "log/d.$testname/$test_number";
   unlink $d_input;
   ok sarun ("-L < $input");
 
@@ -46,7 +45,8 @@ foreach $input (@files) {
 
   {
     print "output: $d_input\n";
-    my $d_output = "log/d.$testname/${Test::ntest}";
+		$test_number = test_number();
+    my $d_output = "log/d.$testname/$test_number";
     unlink $d_output;
     ok sarun ("-d < $d_input");
     ok (-f $d_output);
@@ -62,13 +62,15 @@ foreach $input (@files) {
 	");
 
   # create report_safe 1 and -t output
-  $d_input = "log/d.$testname/${Test::ntest}";
+	$test_number = test_number();
+  $d_input = "log/d.$testname/$test_number";
   unlink $d_input;
   ok sarun ("-L -t < $input");
   ok (-f $d_input);
   {
     print "output: $d_input\n";
-    my $d_output = "log/d.$testname/${Test::ntest}";
+		$test_number = test_number();
+    my $d_output = "log/d.$testname/$test_number";
     unlink $d_output;
     ok sarun ("-d < $d_input");
     ok (-f $d_output);
@@ -89,13 +91,15 @@ tstprefs ("
 	");
 
 # create report_safe 2 output
-$d_input = "log/d.$testname/${Test::ntest}";
+my $test_number = test_number();
+$d_input = "log/d.$testname/$test_number";
 unlink $d_input;
 ok sarun ("-L < $input");
 ok (-f $d_input);
 {
   print "output: $d_input\n";
-  my $d_output = "log/d.$testname/${Test::ntest}";
+  $test_number = test_number();
+  my $d_output = "log/d.$testname/$test_number";
   unlink $d_output;
   ok sarun ("-d < $d_input");
   ok (-f $d_output);
@@ -104,7 +108,8 @@ ok (-f $d_input);
 }
 
 # Work directly on regular message, as though it was not spam
-my $d_output = "log/d.$testname/${Test::ntest}";
+$test_number = test_number();
+my $d_output = "log/d.$testname/$test_number";
 unlink $d_output;
 ok sarun ("-d < $input");
 ok (-f $d_output);

Modified: spamassassin/branches/3.4/t/strip_no_subject.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/strip_no_subject.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/strip_no_subject.t (original)
+++ spamassassin/branches/3.4/t/strip_no_subject.t Mon Feb  5 09:10:12 2018
@@ -2,12 +2,10 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("strip_no_subject");
-use Test;
 
-use constant TEST_ENABLED => conf_bool('run_long_tests');
-
-BEGIN { plan tests => TEST_ENABLED ? 4 : 0 };
-exit unless TEST_ENABLED;
+use Test::More;
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan tests => 4;
 
 # ---------------------------------------------------------------------------
 
@@ -25,9 +23,10 @@ tstprefs ("
 
 # create report_safe 1 and -t output
 sarun ("-L -t < $INPUT");
-if (move("log/d.$testname/${Test::ntest}", $MUNGED)) {
+my $test_number = test_number();
+if (move("log/d.$testname/$test_number", $MUNGED)) {
   sarun ("-d < $MUNGED");
-  ok(!compare_text($INPUT,"log/d.$testname/${Test::ntest}"));
+  ok(!compare_text($INPUT,"log/d.$testname/$test_number"));
 }
 else {
   warn "move failed: $!\n";
@@ -42,9 +41,10 @@ tstprefs ("
 
 # create report_safe 2 output
 sarun ("-L < $INPUT");
-if (move("log/d.$testname/${Test::ntest}", $MUNGED)) {
+$test_number = test_number();
+if (move("log/d.$testname/$test_number", $MUNGED)) {
   sarun ("-d < $MUNGED");
-  ok(!compare_text($INPUT,"log/d.$testname/${Test::ntest}"));
+  ok(!compare_text($INPUT,"log/d.$testname/$test_number"));
 }
 else {
   warn "move failed: $!\n";
@@ -59,9 +59,10 @@ tstprefs ("
 
 # create report_safe 0 output
 sarun ("-L < $INPUT");
-if (move("log/d.$testname/${Test::ntest}", $MUNGED)) {
+$test_number = test_number();
+if (move("log/d.$testname/$test_number", $MUNGED)) {
   sarun ("-d < $MUNGED");
-  ok(!compare_text($INPUT,"log/d.$testname/${Test::ntest}"));
+  ok(!compare_text($INPUT,"log/d.$testname/$test_number"));
 }
 else {
   warn "move failed: $!\n";
@@ -70,4 +71,5 @@ else {
 
 # Work directly on regular message, as though it was not spam
 sarun ("-d < $INPUT");
-ok(!compare_text($INPUT,"log/d.$testname/${Test::ntest}"));
+$test_number = test_number();
+ok(!compare_text($INPUT,"log/d.$testname/$test_number"));

Modified: spamassassin/branches/3.4/t/stripmarkup.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/stripmarkup.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/stripmarkup.t (original)
+++ spamassassin/branches/3.4/t/stripmarkup.t Mon Feb  5 09:10:12 2018
@@ -2,7 +2,7 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("stripmarkup");
-use Test; BEGIN { plan tests => 4 };
+use Test::More tests => 4;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/tainted_msg.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/tainted_msg.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/tainted_msg.t (original)
+++ spamassassin/branches/3.4/t/tainted_msg.t Mon Feb  5 09:10:12 2018
@@ -17,9 +17,9 @@ use SATest; sa_t_init("tainted_msg");
 
 use constant AM_TAINTED => (!defined($ENV{'TEST_PERL_TAINT'}) or $ENV{'TEST_PERL_TAINT'} ne 'no');
 
-use Test; BEGIN { plan tests => AM_TAINTED ? 9 : 0 };
-
-exit unless AM_TAINTED;
+use Test::More;
+plan skip_all => "Not Tainted" unless AM_TAINTED;
+plan tests => 9;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/text_bad_ctype.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/text_bad_ctype.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/text_bad_ctype.t (original)
+++ spamassassin/branches/3.4/t/text_bad_ctype.t Mon Feb  5 09:10:12 2018
@@ -2,7 +2,7 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("text_bad_ctype");
-use Test; BEGIN { plan tests => 2 };
+use Test::More tests => 2;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/timeout.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/timeout.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/timeout.t (original)
+++ spamassassin/branches/3.4/t/timeout.t Mon Feb  5 09:10:12 2018
@@ -18,7 +18,7 @@ if (-e 'test_dir') {            # runnin
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("timeout");
-use Test; BEGIN { plan tests => 33 };
+use Test::More tests => 33;
 
 use strict;
 use Time::HiRes qw(time);

Modified: spamassassin/branches/3.4/t/trust_path.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/trust_path.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/trust_path.t (original)
+++ spamassassin/branches/3.4/t/trust_path.t Mon Feb  5 09:10:12 2018
@@ -27,11 +27,9 @@ if (-e 'test_dir') {            # runnin
 use lib '.'; use lib 't';
 use SATest; sa_t_init("trust_path");
 
-use constant TEST_ENABLED => conf_bool('run_long_tests');
-use Test;
-
-BEGIN { plan tests => TEST_ENABLED ? 96 : 0 };
-exit unless TEST_ENABLED;
+use Test::More;
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan tests => 96;
 
 use IO::File;
 use strict;

Modified: spamassassin/branches/3.4/t/uri.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/uri.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/uri.t (original)
+++ spamassassin/branches/3.4/t/uri.t Mon Feb  5 09:10:12 2018
@@ -16,7 +16,7 @@ if (-e 'test_dir') {            # runnin
 }
 
 use strict;
-use Test;
+use Test::More tests => 95;
 use lib '.'; use lib 't';
 use SATest; sa_t_init("uri");
 
@@ -24,8 +24,6 @@ use Mail::SpamAssassin;
 use Mail::SpamAssassin::HTML;
 use Mail::SpamAssassin::Util;
 
-plan tests => 95;
-
 ##############################################
 
 

Modified: spamassassin/branches/3.4/t/uri_html.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/uri_html.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/uri_html.t (original)
+++ spamassassin/branches/3.4/t/uri_html.t Mon Feb  5 09:10:12 2018
@@ -20,13 +20,10 @@ if (-e 'test_dir') {            # runnin
 use strict;
 use lib '.'; use lib 't';
 use SATest; sa_t_init("uri_html");
-use Test;
+use Test::More tests => 2;
 use Mail::SpamAssassin;
 use vars qw(%patterns %anti_patterns);
 
-# settings
-plan tests => 2;
-
 # initialize SpamAssassin
 my $sa = create_saobj({'dont_copy_prefs' => 1});
 

Modified: spamassassin/branches/3.4/t/uri_text.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/uri_text.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/uri_text.t (original)
+++ spamassassin/branches/3.4/t/uri_text.t Mon Feb  5 09:10:12 2018
@@ -20,13 +20,10 @@ if (-e 'test_dir') {            # runnin
 use strict;
 use lib '.'; use lib 't';
 use SATest; sa_t_init("uri_text");
-use Test;
+use Test::More tests => 683;
 use Mail::SpamAssassin;
 use vars qw(%patterns %anti_patterns);
 
-# settings
-plan tests => 683;
-
 # initialize SpamAssassin
 my $sa = create_saobj({dont_copy_prefs => 1});
 

Modified: spamassassin/branches/3.4/t/uribl.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/uribl.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/uribl.t (original)
+++ spamassassin/branches/3.4/t/uribl.t Mon Feb  5 09:10:12 2018
@@ -3,15 +3,11 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("uribl");
 
-use constant TEST_ENABLED => conf_bool('run_net_tests') && conf_bool('run_long_tests');
-use constant DO_RUN => TEST_ENABLED && can_use_net_dns_safely();
-use Test;
-
-BEGIN {
-  plan tests => (DO_RUN ? 6 : 0),
-};
-
-exit unless (DO_RUN);
+use Test::More;
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan skip_all => "Net tests disabled"          unless conf_bool('run_net_tests');
+plan skip_all => "Can't use Net::DNS Safely"   unless can_use_net_dns_safely();
+plan tests => 6;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/uribl_all_types.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/uribl_all_types.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/uribl_all_types.t (original)
+++ spamassassin/branches/3.4/t/uribl_all_types.t Mon Feb  5 09:10:12 2018
@@ -5,15 +5,11 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("uribl_all_types");
 
-use constant TEST_ENABLED => conf_bool('run_net_tests') && conf_bool('run_long_tests');
-use constant DO_RUN => TEST_ENABLED && can_use_net_dns_safely();
-use Test;
-
-BEGIN {
-  plan tests => (DO_RUN ? 3 : 0),
-};
-
-exit unless (DO_RUN);
+use Test::More;
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan skip_all => "Net tests disabled"                unless conf_bool('run_net_tests');
+plan skip_all => "Can't use Net::DNS Safely"   unless can_use_net_dns_safely();
+plan tests => 3;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/uribl_domains_only.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/uribl_domains_only.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/uribl_domains_only.t (original)
+++ spamassassin/branches/3.4/t/uribl_domains_only.t Mon Feb  5 09:10:12 2018
@@ -4,15 +4,11 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("uribl_domains_only");
 
-use constant TEST_ENABLED => conf_bool('run_net_tests') && conf_bool('run_long_tests');
-use constant DO_RUN => TEST_ENABLED && can_use_net_dns_safely();
-use Test;
-
-BEGIN {
-  plan tests => (DO_RUN ? 4 : 0),
-};
-
-exit unless (DO_RUN);
+use Test::More;
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan skip_all => "Net tests disabled"          unless conf_bool('run_net_tests');
+plan skip_all => "Can't use Net::DNS Safely"   unless can_use_net_dns_safely();
+plan tests => 4;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/uribl_ips_only.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/uribl_ips_only.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/uribl_ips_only.t (original)
+++ spamassassin/branches/3.4/t/uribl_ips_only.t Mon Feb  5 09:10:12 2018
@@ -4,15 +4,11 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("uribl_ips_only");
 
-use constant TEST_ENABLED => conf_bool('run_net_tests') && conf_bool('run_long_tests');
-use constant DO_RUN => TEST_ENABLED && can_use_net_dns_safely();
-use Test;
-
-BEGIN {
-  plan tests => (DO_RUN ? 4 : 0),
-};
-
-exit unless (DO_RUN);
+use Test::More;
+plan skip_all => "Long running tests disabled" unless conf_bool('run_long_tests');
+plan skip_all => "Net tests disabled"          unless conf_bool('run_net_tests');
+plan skip_all => "Can't use Net::DNS Safely"   unless can_use_net_dns_safely();
+plan tests => 4;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/utf8.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/utf8.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/utf8.t (original)
+++ spamassassin/branches/3.4/t/utf8.t Mon Feb  5 09:10:12 2018
@@ -2,7 +2,7 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("utf8");
-use Test; BEGIN { plan tests => 4 };
+use Test::More tests => 4;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/util_wrap.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/util_wrap.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/util_wrap.t (original)
+++ spamassassin/branches/3.4/t/util_wrap.t Mon Feb  5 09:10:12 2018
@@ -18,8 +18,7 @@ if (-e 'test_dir') {            # runnin
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("util_wrap");
-use Test; BEGIN { plan tests => 5 };
-
+use Test::More tests => 5;
 
 use strict;
 require Mail::SpamAssassin::Util;

Modified: spamassassin/branches/3.4/t/whitelist_addrs.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/whitelist_addrs.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/whitelist_addrs.t (original)
+++ spamassassin/branches/3.4/t/whitelist_addrs.t Mon Feb  5 09:10:12 2018
@@ -4,16 +4,9 @@ use lib '.'; use lib 't';
 use SATest; sa_t_init("whitelist_addrs");
 use IO::File;
 
-use constant HAS_MODULES => eval {
-  require DB_File;
-};
+use constant HAS_DB_FILE => eval { require DB_File };
 
-use constant TEST_ENABLED => conf_bool('run_long_tests');
-
-use constant DO_RUN => TEST_ENABLED && HAS_MODULES;
-
-use Test;
-BEGIN { 
+BEGIN {
   if (-e 't/test_dir') {
     chdir 't';
   }
@@ -21,11 +14,12 @@ BEGIN {
   if (-e 'test_dir') {
     unshift(@INC, '../blib/lib');
   }
+}
 
-  plan tests => (DO_RUN ? 35 : 0);
- };
-
-exit unless DO_RUN;
+use Test::More;
+plan skip_all => 'Long running tests disabled' unless conf_bool('run_long_tests');
+plan skip_all => 'Need DB_File for this test'  unless HAS_DB_FILE;
+plan tests => 35;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/whitelist_from.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/whitelist_from.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/whitelist_from.t (original)
+++ spamassassin/branches/3.4/t/whitelist_from.t Mon Feb  5 09:10:12 2018
@@ -3,11 +3,9 @@
 use lib '.'; use lib 't';
 use SATest; sa_t_init("whitelist_from");
 
-use constant TEST_ENABLED => conf_bool('run_long_tests');
-
-use Test;
-BEGIN { plan tests => TEST_ENABLED ? 32 : 0 };
-exit unless TEST_ENABLED;
+use Test::More;
+plan skip_all => 'Long running tests disabled' unless conf_bool('run_long_tests');
+plan tests => 32;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/whitelist_subject.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/whitelist_subject.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/whitelist_subject.t (original)
+++ spamassassin/branches/3.4/t/whitelist_subject.t Mon Feb  5 09:10:12 2018
@@ -2,7 +2,7 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("whitelist_subject");
-use Test; BEGIN { plan tests => 4 };
+use Test::More tests => 4;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/whitelist_to.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/whitelist_to.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/whitelist_to.t (original)
+++ spamassassin/branches/3.4/t/whitelist_to.t Mon Feb  5 09:10:12 2018
@@ -2,7 +2,7 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("whitelist_to");
-use Test; BEGIN { plan tests => 1 };
+use Test::More tests => 1;
 
 # ---------------------------------------------------------------------------
 

Modified: spamassassin/branches/3.4/t/zz_cleanup.t
URL: http://svn.apache.org/viewvc/spamassassin/branches/3.4/t/zz_cleanup.t?rev=1823142&r1=1823141&r2=1823142&view=diff
==============================================================================
--- spamassassin/branches/3.4/t/zz_cleanup.t (original)
+++ spamassassin/branches/3.4/t/zz_cleanup.t Mon Feb  5 09:10:12 2018
@@ -2,7 +2,7 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("zz_cleanup");
-use Test; BEGIN { plan tests => 1 };
+use Test::More tests => 1;
 
 use File::Path;