test/udev-test: gracefully exit when imports fail
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 17 Nov 2020 16:13:31 +0000 (17:13 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 17 Nov 2020 18:50:17 +0000 (03:50 +0900)
commitd40763838278246e2073d15ca927ee700e583afc
tree8a407fcc109877a59e68035041744c55400bf0e7
parent07e4a8dc2353e410020245aa5f448f41a4ef2b57
test/udev-test: gracefully exit when imports fail

In Fedora rawhide various perl modules are now available as separate
packages that are not pulled in by dependencies. If we don't have some
package, skip the tests.

This ugly code is apparently the way to do conditional imports:
https://www.cs.ait.ac.th/~on/O/oreilly/perl/cookbook/ch12_03.htm.
test/udev-test.pl