summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Fredric <kentnl@gentoo.org>2017-12-14 20:38:05 +1300
committerKent Fredric <kentnl@gentoo.org>2017-12-14 21:00:23 +1300
commitd32c75f5941615ae6cda7c3efae7f556d618d398 (patch)
treee49f2bd03e05ae79f6ad87a412a22919aa0a9a5d
parentmail-client/mutt: fix USE-flags enabling after rename change, bug #640824 (diff)
downloadgentoo-d32c75f5941615ae6cda7c3efae7f556d618d398.tar.gz
gentoo-d32c75f5941615ae6cda7c3efae7f556d618d398.tar.bz2
gentoo-d32c75f5941615ae6cda7c3efae7f556d618d398.zip
dev-perl/Net-PcapUtils: EAPI6 + Enable tests
- EAPI6ify - Enable tests - Organise tests to do the right thing in different environments Package-Manager: Portage-2.3.18, Repoman-2.3.6
-rw-r--r--dev-perl/Net-PcapUtils/Net-PcapUtils-0.10.0-r2.ebuild26
-rw-r--r--dev-perl/Net-PcapUtils/files/Net-PcapUtils-0.01-testsuite.patch85
2 files changed, 111 insertions, 0 deletions
diff --git a/dev-perl/Net-PcapUtils/Net-PcapUtils-0.10.0-r2.ebuild b/dev-perl/Net-PcapUtils/Net-PcapUtils-0.10.0-r2.ebuild
new file mode 100644
index 000000000000..f6f9f7912ed7
--- /dev/null
+++ b/dev-perl/Net-PcapUtils/Net-PcapUtils-0.10.0-r2.ebuild
@@ -0,0 +1,26 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+DIST_AUTHOR=TIMPOTTER
+DIST_VERSION=0.01
+inherit perl-module
+
+DESCRIPTION="Utility routines for use with Net::Pcap"
+
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE=""
+
+RDEPEND="dev-perl/Net-Pcap"
+DEPEND="${RDEPEND}"
+PATCHES=("${FILESDIR}/${PN}-0.01-testsuite.patch")
+
+src_test() {
+ if [[ $EUID != 0 ]]; then
+ elog "Some tests require root privileges. For details, see:"
+ elog "https://wiki.gentoo.org/wiki/Project:Perl/maint-notes/${CATEGORY}/${PN}"
+ fi
+ perl-module_src_test
+}
diff --git a/dev-perl/Net-PcapUtils/files/Net-PcapUtils-0.01-testsuite.patch b/dev-perl/Net-PcapUtils/files/Net-PcapUtils-0.01-testsuite.patch
new file mode 100644
index 000000000000..c820e963ed69
--- /dev/null
+++ b/dev-perl/Net-PcapUtils/files/Net-PcapUtils-0.01-testsuite.patch
@@ -0,0 +1,85 @@
+From 943ea70672f52f1d7548723a1ef8f15b6249fdc2 Mon Sep 17 00:00:00 2001
+From: Kent Fredric <kentnl@gentoo.org>
+Date: Thu, 14 Dec 2017 19:19:07 +1300
+Subject: Fix test suite to be useful in non-root environments
+
+While also exposing the need to be root to run certain tests
+---
+ t/00-compile.t | 9 +++++++++
+ t/01-loop.t | 6 ++++++
+ t/02-open.t | 7 +++++++
+ t/03-next.t | 7 +++++++
+ 4 files changed, 29 insertions(+)
+ create mode 100644 t/00-compile.t
+
+diff --git a/t/00-compile.t b/t/00-compile.t
+new file mode 100644
+index 0000000..7f2ace4
+--- /dev/null
++++ b/t/00-compile.t
+@@ -0,0 +1,9 @@
++
++use strict;
++use warnings;
++
++print "1..1\n";
++
++local $@;
++eval { require Net::PcapUtils };
++printf "%s load Net::PcapUtils\n", ( $@ ? 'not ok' : 'ok' );
+diff --git a/t/01-loop.t b/t/01-loop.t
+index be7850c..92ad7a6 100644
+--- a/t/01-loop.t
++++ b/t/01-loop.t
+@@ -6,6 +6,12 @@
+ #
+
+ use strict;
++BEGIN {
++ if ( $> != 0 ) {
++ print "1..0 # SKIP This test requires running as root";
++ exit 0;
++ }
++}
+ use ExtUtils::testlib;
+
+ use Net::PcapUtils;
+diff --git a/t/02-open.t b/t/02-open.t
+index 81c8e19..de95e5b 100644
+--- a/t/02-open.t
++++ b/t/02-open.t
+@@ -6,6 +6,13 @@
+ #
+
+ use strict;
++BEGIN {
++ if ( $> != 0 ) {
++ print "1..0 # SKIP This test requires running as root";
++ exit 0;
++ }
++}
++
+ use ExtUtils::testlib;
+
+ use Net::Pcap;
+diff --git a/t/03-next.t b/t/03-next.t
+index b473816..330915e 100644
+--- a/t/03-next.t
++++ b/t/03-next.t
+@@ -6,6 +6,13 @@
+ #
+
+ use strict;
++BEGIN {
++ if ( $> != 0 ) {
++ print "1..0 # SKIP This test requires running as root";
++ exit 0;
++ }
++}
++
+ use ExtUtils::testlib;
+
+ use Net::PcapUtils;
+--
+2.15.1
+