dev-ruby/libusb: avoid tests that touch real usb devices

* Hangs intermittently especially if you have multiple ruby targets
  enabled.
* This follows how upstream handles it in their CI.

Signed-off-by: Alfred Wingate <parona@protonmail.com>
Part-of: https://codeberg.org/gentoo/gentoo/pulls/1457
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Alfred Wingate
2026-07-19 07:42:52 +01:00
committed by Sam James
parent 48b2744fc3
commit ffb9045d6c
+5 -5
View File
@@ -1,4 +1,4 @@
# Copyright 2022-2024 Gentoo Authors
# Copyright 2022-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -28,13 +28,13 @@ all_ruby_prepare() {
-e 's/git ls-files --/find/' \
-e 's/git ls-files/find */' \
-i ${RUBY_FAKEGEM_GEMSPEC} || die
# Avoid tests that try to open devices or depend on specific hardware
rm -f test/test_libusb_{bos,bulk_stream_transfer,descriptors}.rb || die
}
each_ruby_test() {
${RUBY} -I.:lib -e "Dir['test/test_*.rb'].each{|f| require f}" || die
# https://github.com/larskanis/libusb/tree/master#testing-libusb-gem
# See ci task in the rakefile
${RUBY} -I.:lib -e "Dir['test/test_libusb(_structs)?.rb'].each{|f| require f}" -- --verbose || die
}
each_ruby_install() {