aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorswills <swills@FreeBSD.org>2012-05-09 19:22:20 +0800
committerswills <swills@FreeBSD.org>2012-05-09 19:22:20 +0800
commitb9bb50bea2a16231370d792f8d50ace6e4edac38 (patch)
tree1e87a310c1c45f630d40b2058067e0c5c9a9827b /net
parent3bc9bac31ec52b2effcc21798fab2c75e57dbb0f (diff)
downloadfreebsd-ports-gnome-b9bb50bea2a16231370d792f8d50ace6e4edac38.tar.gz
freebsd-ports-gnome-b9bb50bea2a16231370d792f8d50ace6e4edac38.tar.zst
freebsd-ports-gnome-b9bb50bea2a16231370d792f8d50ace6e4edac38.zip
- Fix tests
PR: ports/166698 Submited by: Mel Flynn <rflynn@acsalaska.net>
Diffstat (limited to 'net')
-rw-r--r--net/p5-Net-Pcap/Makefile10
-rw-r--r--net/p5-Net-Pcap/files/extra-patch-t__03-openlive.t14
-rw-r--r--net/p5-Net-Pcap/files/patch-t__Utils.pm11
3 files changed, 34 insertions, 1 deletions
diff --git a/net/p5-Net-Pcap/Makefile b/net/p5-Net-Pcap/Makefile
index 49e7d1af9870..21b30754f79f 100644
--- a/net/p5-Net-Pcap/Makefile
+++ b/net/p5-Net-Pcap/Makefile
@@ -15,10 +15,18 @@ MAINTAINER= perl@FreeBSD.org
COMMENT= Interface to pcap(3) LBL packet capture library
RUN_DEPENDS= ${SITE_PERL}/${PERL_ARCH}/IO/Interface.pm:${PORTSDIR}/net/p5-IO-Interface
+TEST_DEPENDS= p5-Socket>=0:${PORTSDIR}/net/p5-Socket \
+ p5-Test-Exception>=0:${PORTSDIR}/devel/p5-Test-Exception
PERL_CONFIGURE= yes
MAN1= pcapinfo.1
MAN3= Net::Pcap.3
-.include <bsd.port.mk>
+.include <bsd.port.pre.mk>
+
+.if ${OSVERSION} >= 800000
+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-t__03-openlive.t
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/net/p5-Net-Pcap/files/extra-patch-t__03-openlive.t b/net/p5-Net-Pcap/files/extra-patch-t__03-openlive.t
new file mode 100644
index 000000000000..05d5559e2f83
--- /dev/null
+++ b/net/p5-Net-Pcap/files/extra-patch-t__03-openlive.t
@@ -0,0 +1,14 @@
+--- t/03-openlive.t.orig 2007-12-22 10:46:39.000000000 -0900
++++ t/03-openlive.t 2012-04-05 16:45:58.000000000 -0800
+@@ -64,8 +64,10 @@
+ is( $@, '', "open_live()" );
+ if($^O eq 'MSWin32' or $^O eq 'cygwin') {
+ like( $err, '/^Error opening adapter:/', " - \$err must be set: $err" );
+-} elsif($^O eq 'darwin' or $^O eq 'freebsd' or $^O eq 'openbsd') {
++} elsif($^O eq 'darwin' or $^O eq 'openbsd') {
+ like( $err, "/^(?:BIOCSETIF: )?$fakedev: Device not configured/", " - \$err must be set: $err" );
++} elsif($^O eq 'freebsd') {
++ is( $err, ''); # Since pcap 1.0.0 nonexisting gives empty string.
+ } else {
+ like( $err, '/^(?:bind|ioctl|SIOCGIFHWADDR): (?:No such device)/', " - \$err must be set: $err" );
+ }
diff --git a/net/p5-Net-Pcap/files/patch-t__Utils.pm b/net/p5-Net-Pcap/files/patch-t__Utils.pm
new file mode 100644
index 000000000000..43a1068a3cdf
--- /dev/null
+++ b/net/p5-Net-Pcap/files/patch-t__Utils.pm
@@ -0,0 +1,11 @@
+--- t/Utils.pm.orig 2012-04-05 17:39:45.000000000 -0800
++++ t/Utils.pm 2012-04-05 17:41:15.000000000 -0800
+@@ -73,7 +73,7 @@
+ my @devs = Net::Pcap::findalldevs(\%devs, \$err);
+
+ # filter out unusable devices
+-@devs = grep { $_ ne "lo" and $_ ne "lo0" and $_ !~ /GenericDialupAdapter/ } @devs;
++@devs = grep { $_ ne "lo" and $_ ne "lo0" and $_ !~ /GenericDialupAdapter/ and $_ !~ /^usbus/ } @devs;
+
+ # check if the user has specified a prefered device to use for tests
+ if (open(PREF, "device.txt")) {