dev-perl/Net-XMPP: Fix tests re bug #623002 and bug #612256
authorKent Fredric <kentnl@gentoo.org>
Wed, 29 Nov 2017 06:33:12 +0000 (19:33 +1300)
committerKent Fredric <kentnl@gentoo.org>
Wed, 29 Nov 2017 06:33:58 +0000 (19:33 +1300)
- Fix test failures without '.' in @INC (#623002)
- Update network-test patch to skip another network test (#612256)
- Simplify patching logic
- use DIST_EXAMPLES feature for examples

Bug: https://bugs.gentoo.org/623002
Bug: https://bugs.gentoo.org/612256
Package-Manager: Portage-2.3.14, Repoman-2.3.6

dev-perl/Net-XMPP/Manifest
dev-perl/Net-XMPP/Net-XMPP-1.50.0.ebuild
dev-perl/Net-XMPP/files/1.05-no-dot-inc.patch [new file with mode: 0644]
dev-perl/Net-XMPP/files/1.05-no-network-tests.patch

index 7dcb553ebc5239c7fb51f70b507665a3eb5d82ac..22faef461284a551e23c44ac5c36345e21f94845 100644 (file)
@@ -1,2 +1,2 @@
 DIST Net-XMPP-1.02.tar.gz 121653 SHA256 69761441e214042b10b6608afaffbb1b5262e4aaaddb4b315dbf2ea48c4742ea SHA512 7a373e627de7e909ef50d6525b438dd7f094c7e6ad3cb66fff6087048fe9b127e376cf45d1621e55deec2c59fe043ff19f180d0b264fa1dd0c392701dfc43497 WHIRLPOOL e3238e9dac4caf00de645c9eadbc530b725a6872a89ee82043931b7d21a6375419554020dc573aeed3b4415f8a65ddc4685c497bfe1951dd5d802d4fb8557b70
-DIST Net-XMPP-1.05.tar.gz 103876 SHA256 4c02200577c2b235a163a09bfaa152bf000fe5f1499ad80ce16ab66808949362 SHA512 cdd5474fcbdf7ff6c7d1247f9828f5dfb1828c258af366a831bab8e5faab423b73aa16c34228818526ebcc3180ef0ccc52d6e6cb61e2fe689458b87ec7fab699 WHIRLPOOL 9aee53ba25515722c88c4e810fdae78751b811426c70df39d57c2b606436278c143f2592230f605fee49edab7617cd37faf1e1fd20eaed7908f364049e4ee3da
+DIST Net-XMPP-1.05.tar.gz 103876 BLAKE2B 5ddc98125b26518c59aa4ab39a974b9cbf1575bd59bb66d5329a43e1d5c3d150f34cc93f545f2cd56846e7b4e46142c47aff7da9b279181a02a57bf95ff1757b SHA512 cdd5474fcbdf7ff6c7d1247f9828f5dfb1828c258af366a831bab8e5faab423b73aa16c34228818526ebcc3180ef0ccc52d6e6cb61e2fe689458b87ec7fab699
index 15a7bce721984d88d5f93bac56f84a6a63142a79..328c35269151603c24e6773d89156001cd8200de 100644 (file)
@@ -1,10 +1,11 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
 
 DIST_AUTHOR=DAPATRICK
 DIST_VERSION=1.05
+DIST_EXAMPLES=( "examples/*" )
 inherit perl-module
 
 DESCRIPTION="XMPP Perl Library"
@@ -12,7 +13,7 @@ DESCRIPTION="XMPP Perl Library"
 LICENSE="LGPL-2.1"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
-IUSE="test examples"
+IUSE="test"
 
 RDEPEND="
        >=dev-perl/Authen-SASL-2.120.0
@@ -28,16 +29,7 @@ DEPEND="${RDEPEND}
                >=virtual/perl-Test-Simple-0.920.0
        )
 "
-src_test() {
-       eapply "${FILESDIR}/${DIST_VERSION}-no-network-tests.patch"
-       perl-module_src_test
-}
-
-src_install() {
-       perl-module_src_install
-       if use examples; then
-               docompress -x /usr/share/doc/${PF}/examples
-               insinto /usr/share/doc/${PF}/examples
-               doins -r examples/*
-       fi
-}
+PATCHES=(
+       "${FILESDIR}/${DIST_VERSION}-no-network-tests.patch"
+       "${FILESDIR}/${DIST_VERSION}-no-dot-inc.patch"
+)
diff --git a/dev-perl/Net-XMPP/files/1.05-no-dot-inc.patch b/dev-perl/Net-XMPP/files/1.05-no-dot-inc.patch
new file mode 100644 (file)
index 0000000..773b9f0
--- /dev/null
@@ -0,0 +1,133 @@
+From bad1310f14223c12c1d8933ef5de17fd323374f5 Mon Sep 17 00:00:00 2001
+From: Kent Fredric <kentnl@gentoo.org>
+Date: Wed, 29 Nov 2017 19:07:38 +1300
+Subject: Fix tests failing under Perl 5.26 w/ PERL_USE_UNSAFE_INC=0
+
+    require t/foo.pl
+
+Used to work as a result of the assumed '.' at the end of `@INC`.
+This is no longer true under Perl 5.26 without PERL_USE_UNSAFE_INC=1
+in your environment (which gets defaulted on under CPAN installers and
+under Test::Harness if not explicitly disabled, and will be hard-off
+in Perl 5.30)
+
+Bug: https://bugs.gentoo.org/623002
+Bug: https://github.com/dap/Net-XMPP/pull/16
+---
+ t/iq.t              | 2 +-
+ t/jid.t             | 2 +-
+ t/message.t         | 2 +-
+ t/packet_iqauth.t   | 2 +-
+ t/packet_iqroster.t | 2 +-
+ t/presence.t        | 2 +-
+ t/rawxml.t          | 2 +-
+ t/roster.t          | 2 +-
+ 8 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/t/iq.t b/t/iq.t
+index 9174e6d..1742d6c 100644
+--- a/t/iq.t
++++ b/t/iq.t
+@@ -3,7 +3,7 @@ use Test::More tests=>115;
+ BEGIN{ use_ok( "Net::XMPP" ); }
+-require "t/mytestlib.pl";
++require "./t/mytestlib.pl";
+ my $debug = Net::XMPP::Debug->new(setdefault=>1,
+                                  level=>-1,
+diff --git a/t/jid.t b/t/jid.t
+index dc07440..fa426a4 100644
+--- a/t/jid.t
++++ b/t/jid.t
+@@ -3,7 +3,7 @@ use Test::More tests=>15;
+ BEGIN{ use_ok( "Net::XMPP" ); }
+-require "t/mytestlib.pl";
++require "./t/mytestlib.pl";
+ my $jid = Net::XMPP::JID->new('host.com/xxx@yyy.com/zzz');
+ ok( defined($jid), "new()" );
+diff --git a/t/message.t b/t/message.t
+index 70bcef8..7c2f554 100644
+--- a/t/message.t
++++ b/t/message.t
+@@ -3,7 +3,7 @@ use Test::More tests=>136;
+ BEGIN{ use_ok( "Net::XMPP" ); }
+-require "t/mytestlib.pl";
++require "./t/mytestlib.pl";
+ my $debug = Net::XMPP::Debug->new(setdefault=>1,
+                                  level=>-1,
+diff --git a/t/packet_iqauth.t b/t/packet_iqauth.t
+index 748917b..f80b5ae 100644
+--- a/t/packet_iqauth.t
++++ b/t/packet_iqauth.t
+@@ -3,7 +3,7 @@ use Test::More tests=>55;
+ BEGIN{ use_ok( "Net::XMPP" ); }
+-require "t/mytestlib.pl";
++require "./t/mytestlib.pl";
+ my $debug = Net::XMPP::Debug->new(setdefault=>1,
+                                  level=>-1,
+diff --git a/t/packet_iqroster.t b/t/packet_iqroster.t
+index 706e5f0..4bd48e8 100644
+--- a/t/packet_iqroster.t
++++ b/t/packet_iqroster.t
+@@ -3,7 +3,7 @@ use Test::More tests=>57;
+ BEGIN{ use_ok( "Net::XMPP" ); }
+-require "t/mytestlib.pl";
++require "./t/mytestlib.pl";
+ my $debug = Net::XMPP::Debug->new(setdefault=>1,
+                                  level=>-1,
+diff --git a/t/presence.t b/t/presence.t
+index ce6980d..14f9516 100644
+--- a/t/presence.t
++++ b/t/presence.t
+@@ -3,7 +3,7 @@ use Test::More tests=>132;
+ BEGIN{ use_ok( "Net::XMPP" ); }
+-require "t/mytestlib.pl";
++require "./t/mytestlib.pl";
+ my $debug = Net::XMPP::Debug->new(setdefault=>1,
+                                  level=>-1,
+diff --git a/t/rawxml.t b/t/rawxml.t
+index b4f091b..43b6380 100644
+--- a/t/rawxml.t
++++ b/t/rawxml.t
+@@ -3,7 +3,7 @@ use Test::More tests=>54;
+ BEGIN{ use_ok( "Net::XMPP" ); }
+-require "t/mytestlib.pl";
++require "./t/mytestlib.pl";
+ my $message = Net::XMPP::Message->new();
+ ok( defined($message), "new()");
+diff --git a/t/roster.t b/t/roster.t
+index 19ed87b..a365d2e 100644
+--- a/t/roster.t
++++ b/t/roster.t
+@@ -11,7 +11,7 @@ BEGIN {
+ }
+ BEGIN{ use_ok( "Net::XMPP" ); }
+-require "t/mytestlib.pl";
++require "./t/mytestlib.pl";
+ my $debug = Net::XMPP::Debug->new(setdefault=>1,
+                                  level=>-1,
+-- 
+2.14.3
+
index 921121805defb95aba3018163a75ce4273ebf63f..e20b39316b943a9bbb998595d99fe71375e689ab 100644 (file)
@@ -1,7 +1,20 @@
-diff -Naur Net-XMPP-1.05/t/gtalk.t Net-XMPP-1.05b/t/gtalk.t
---- Net-XMPP-1.05/t/gtalk.t    2014-12-22 21:28:51.000000000 +0000
-+++ Net-XMPP-1.05b/t/gtalk.t   2016-03-06 07:14:13.313580716 +0000
-@@ -2,7 +2,12 @@
+From ce5bd091758174c06e0b250040d85b1cc1c8bad0 Mon Sep 17 00:00:00 2001
+From: Kent Fredric <kentnl@gentoo.org>
+Date: Sun, 6 Mar 2016 20:35:45 +1300
+Subject: Disable network tests when tests forcibly required by ENV
+
+Bug: https://bugs.gentoo.org/612256
+---
+ t/gtalk.t                    |  7 ++++++-
+ t/lib/Net/XMPP/Test/Utils.pm |  1 +
+ t/roster.t                   | 10 +++++++++-
+ 3 files changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/t/gtalk.t b/t/gtalk.t
+index 747b7df..3b1af73 100644
+--- a/t/gtalk.t
++++ b/t/gtalk.t
+@@ -2,7 +2,12 @@ use strict;
  use warnings;
  
  use Test::More;
@@ -15,10 +28,11 @@ diff -Naur Net-XMPP-1.05/t/gtalk.t Net-XMPP-1.05b/t/gtalk.t
  ######################## XML::Stream mocking starts
  #{
  #   package XML::Stream;
-diff -Naur Net-XMPP-1.05/t/lib/Net/XMPP/Test/Utils.pm Net-XMPP-1.05b/t/lib/Net/XMPP/Test/Utils.pm
---- Net-XMPP-1.05/t/lib/Net/XMPP/Test/Utils.pm 2014-12-22 21:28:51.000000000 +0000
-+++ Net-XMPP-1.05b/t/lib/Net/XMPP/Test/Utils.pm        2016-03-06 06:59:57.227261659 +0000
-@@ -23,6 +23,7 @@
+diff --git a/t/lib/Net/XMPP/Test/Utils.pm b/t/lib/Net/XMPP/Test/Utils.pm
+index d69eca3..3c4565e 100644
+--- a/t/lib/Net/XMPP/Test/Utils.pm
++++ b/t/lib/Net/XMPP/Test/Utils.pm
+@@ -23,6 +23,7 @@ sub can_run_tests {
  }
  
  sub conn_is_available {
@@ -26,3 +40,26 @@ diff -Naur Net-XMPP-1.05/t/lib/Net/XMPP/Test/Utils.pm Net-XMPP-1.05b/t/lib/Net/X
        return online();
  }
  
+diff --git a/t/roster.t b/t/roster.t
+index 25ee505..19ed87b 100644
+--- a/t/roster.t
++++ b/t/roster.t
+@@ -1,6 +1,14 @@
+ use lib "t/lib";
+-use Test::More tests=>75;
++BEGIN {
++  require Test::More;
++  if ($ENV{NO_NETWORK_TESTING}) {
++    Test::More->import(skip_all => "NO_NETWORK_TESTS set");
++  }
++  else {
++    Test::More->import( tests => 75 );
++  }
++}
+ BEGIN{ use_ok( "Net::XMPP" ); }
+ require "t/mytestlib.pl";
+-- 
+2.14.3
+