r2664 - in /packages/libemail-valid-perl/trunk: debian/changelog debian/rules t/valid.t

ron at users.alioth.debian.org ron at users.alioth.debian.org
Sun Apr 30 08:35:22 UTC 2006


Author: ron
Date: Sun Apr 30 08:35:21 2006
New Revision: 2664

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=2664
Log:

Skip the network tests if no DNS appears available,
but otherwise fail hard (again) if tests don't succeed.


Modified:
    packages/libemail-valid-perl/trunk/debian/changelog
    packages/libemail-valid-perl/trunk/debian/rules
    packages/libemail-valid-perl/trunk/t/valid.t

Modified: packages/libemail-valid-perl/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-valid-perl/trunk/debian/changelog?rev=2664&op=diff
==============================================================================
--- packages/libemail-valid-perl/trunk/debian/changelog (original)
+++ packages/libemail-valid-perl/trunk/debian/changelog Sun Apr 30 08:35:21 2006
@@ -1,6 +1,12 @@
 libemail-valid-perl (0.15-5) unstable; urgency=low
 
   * Set the maintainer field to the DPG.
+  * Improve the tests to 'skip' any which can't be performed instead
+    of just ignoring them or faking an 'ok' result.  The network tests
+    now can only fail if Net::DNS::mx independently succeeds, and the
+    package builds will fail in the event of a real test failure again.
+    Enhances the 'fix' for #336188 and Closes: #363999.
+    Thanks again to Don for the prod to do this.
 
  -- Ron Lee <ron at debian.org>  Fri, 28 Apr 2006 23:46:12 +0930
 

Modified: packages/libemail-valid-perl/trunk/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-valid-perl/trunk/debian/rules?rev=2664&op=diff
==============================================================================
--- packages/libemail-valid-perl/trunk/debian/rules (original)
+++ packages/libemail-valid-perl/trunk/debian/rules Sun Apr 30 08:35:21 2006
@@ -37,7 +37,7 @@
 	dh_testdir
 	dh_testroot
 	dh_clean -k
-	-$(MAKE) test
+	$(MAKE) test
 	$(MAKE) install PREFIX=$(TMP)/usr
         
 	#As this is a architecture independent package, we are not supposed to install

Modified: packages/libemail-valid-perl/trunk/t/valid.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libemail-valid-perl/trunk/t/valid.t?rev=2664&op=diff
==============================================================================
--- packages/libemail-valid-perl/trunk/t/valid.t (original)
+++ packages/libemail-valid-perl/trunk/t/valid.t Sun Apr 30 08:35:21 2006
@@ -23,6 +23,10 @@
 
 sub not_ok { print "not ok $test\n"; $test++ }
 sub ok { print "ok $test\n"; $test++ }
+sub skipnet { print "ok $test # skip Network nameserver not available\n";
+              $test++ }
+sub skiptld { print "ok $test # skip Net::Domain::TLD not available\n";
+              $test++ }
 
 $v->address('Alfred Neuman <Neuman at BBN-TENEXA>') ? not_ok : ok;
 
@@ -43,17 +47,23 @@
 $a = $v->address("fred&barney\@stonehenge(yup, the rock place).(that's dot)com");
 $a eq 'fred&barney at stonehenge.com' ? ok : not_ok;   
 
-$v->address( -address => 'blort at aol.com',
-             -mxcheck => 1) ? ok : not_ok;
-$v->address( -address => 'blort at notarealdomainfoo.com',
-             -mxcheck => 1) ? not_ok : ok;   
+eval {require Net::DNS};
+if( !$@ && Net::DNS::mx('debian.org') )
+{
+    $v->address( -address => 'blort at debian.org',
+                 -mxcheck => 1) ? ok : not_ok;
+    $v->address( -address => 'blort at notarealdomainfoo.com',
+                 -mxcheck => 1) ? not_ok : ok;   
 
-eval {require Net::Domain::TLD};
-if ($@) {
-    ok; ok;
+    eval {require Net::Domain::TLD};
+    if ($@) {
+        skiptld; skiptld;
+    } else {
+        $v->address( -address => 'blort at notarealdomainfoo.com',
+                     -tldcheck => 1) ? ok : not_ok;   
+        $v->address( -address => 'blort at notarealdomainfoo.bla',
+                     -tldcheck => 1) ? not_ok : ok;   
+    }
 } else {
-    $v->address( -address => 'blort at notarealdomainfoo.com',
-                 -tldcheck => 1) ? ok : not_ok;   
-    $v->address( -address => 'blort at notarealdomainfoo.bla',
-                 -tldcheck => 1) ? not_ok : ok;   
+    skipnet; skipnet; skipnet; skipnet;
 }




More information about the Pkg-perl-cvs-commits mailing list