From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ruby/pcaprub/
Date: Mon, 27 Mar 2023 13:25:21 +0000 (UTC) [thread overview]
Message-ID: <1679923438.1b48d59f69f5ac0d162437b13601f7b666d3eed2.sam@gentoo> (raw)
commit: 1b48d59f69f5ac0d162437b13601f7b666d3eed2
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 27 12:43:13 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar 27 13:23:58 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1b48d59f
dev-ruby/pcaprub: wire up tests
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-ruby/pcaprub/pcaprub-0.13.1.ebuild | 51 ++++++++++++++++++++++++++++++----
1 file changed, 45 insertions(+), 6 deletions(-)
diff --git a/dev-ruby/pcaprub/pcaprub-0.13.1.ebuild b/dev-ruby/pcaprub/pcaprub-0.13.1.ebuild
index a2557b0dd274..b977b4d6165b 100644
--- a/dev-ruby/pcaprub/pcaprub-0.13.1.ebuild
+++ b/dev-ruby/pcaprub/pcaprub-0.13.1.ebuild
@@ -1,14 +1,13 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
-USE_RUBY="ruby26 ruby27 ruby30"
+USE_RUBY="ruby27 ruby30"
RUBY_FAKEGEM_EXTRADOC="FAQ.rdoc README.rdoc USAGE.rdoc"
-
RUBY_FAKEGEM_EXTENSIONS=(ext/pcaprub_c/extconf.rb)
-
+RUBY_FAKEGEM_TASK_TEST="test"
inherit ruby-fakegem
DESCRIPTION="Libpcap bindings for ruby compat"
@@ -21,5 +20,45 @@ KEYWORDS="~amd64 ~arm ~x86"
DEPEND+="net-libs/libpcap"
RDEPEND+="net-libs/libpcap"
-# Tests require live access to a network device as root.
-RESTRICT="test"
+ruby_add_bdepend "
+ test? (
+ >=dev-ruby/rake-compiler-0.6.0
+ )
+"
+
+all_ruby_prepare() {
+ sed -i \
+ -e '/\(minitest\|shoulda-context\)/s:~>:>=:' \
+ -e '/coveralls/d' \
+ -e '/rubygems-tasks/d' \
+ -e '/gem.*git/d' \
+ Gemfile || die
+
+ sed -i \
+ -e '/rubygems\/tasks/d' \
+ -e '/Gem::Tasks/d' \
+ -e "/^require 'git'/,/end/ s/^/#/" \
+ Rakefile || die
+
+ sed -i -e '/coveralls/Id' test/test_helper.rb || die
+
+ # Tests which need escalated privileges
+ local privileged_tests=(
+ test_set_datalink
+ test_create_from_primitives
+ test_filter
+ test_pcap_stats
+ test_pcap_datalink
+ test_pcap_inject
+ test_pcap_next
+ test_pcap_setfilter
+ test_pcap_snapshot
+ )
+
+ local privileged_tests_expr=$(printf "%s\|" "${privileged_tests[@]}")
+ privileged_tests_expr="${privileged_tests_expr::-2}"
+
+ sed -i \
+ -e "/def \(${privileged_tests_expr}\)/,/^ end/s/^/#/" \
+ test/test_pcaprub_unit.rb || die
+}
next reply other threads:[~2023-03-27 13:25 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-27 13:25 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-07-30 5:26 [gentoo-commits] repo/gentoo:master commit in: dev-ruby/pcaprub/ Hans de Graaff
2024-07-30 5:26 Hans de Graaff
2024-04-24 11:56 Hans de Graaff
2024-04-24 5:44 Hans de Graaff
2024-01-26 8:01 Hans de Graaff
2023-07-11 7:47 Hans de Graaff
2023-04-03 5:08 Sam James
2023-03-27 13:25 Sam James
2021-10-30 5:16 Hans de Graaff
2021-10-26 4:38 Hans de Graaff
2021-04-10 6:17 Hans de Graaff
2020-08-01 9:05 Hans de Graaff
2019-01-28 21:45 Hans de Graaff
2018-07-27 3:03 Hans de Graaff
2018-02-24 8:49 Hans de Graaff
2018-01-22 19:26 Hans de Graaff
2018-01-22 19:26 Hans de Graaff
2016-05-29 5:47 Hans de Graaff
2016-05-29 5:47 Hans de Graaff
2016-05-29 5:47 Hans de Graaff
2016-01-21 6:53 Hans de Graaff
2015-09-06 20:39 Richard Farina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1679923438.1b48d59f69f5ac0d162437b13601f7b666d3eed2.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox