From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1E69C15864F for ; Mon, 27 Mar 2023 13:25:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AE8B2E08FB; Mon, 27 Mar 2023 13:25:25 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9418EE08F7 for ; Mon, 27 Mar 2023 13:25:25 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B941D33BE6B for ; Mon, 27 Mar 2023 13:25:24 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0A4B5991 for ; Mon, 27 Mar 2023 13:25:21 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1679923438.1b48d59f69f5ac0d162437b13601f7b666d3eed2.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-ruby/pcaprub/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-ruby/pcaprub/pcaprub-0.13.1.ebuild X-VCS-Directories: dev-ruby/pcaprub/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 1b48d59f69f5ac0d162437b13601f7b666d3eed2 X-VCS-Branch: master Date: Mon, 27 Mar 2023 13:25:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0035de55-c9fb-49b2-8266-0b0f86f83ddc X-Archives-Hash: ee3d7940443c908341350e63890ad8e9 commit: 1b48d59f69f5ac0d162437b13601f7b666d3eed2 Author: Sam James gentoo org> AuthorDate: Mon Mar 27 12:43:13 2023 +0000 Commit: Sam James gentoo 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 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 +}