From: Eric Wong Date: Mon, 19 Aug 2024 20:46:36 +0000 (+0000) Subject: t/inotify3: fail gracefully on unsupported arches X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=849703c4b5101f2614b20b401241662b43111912;p=thirdparty%2Fpublic-inbox.git t/inotify3: fail gracefully on unsupported arches New architectures will inevitably appear or lose support, so ensure we fail gracefully here with some hopefully helpful messages. --- diff --git a/t/inotify3.t b/t/inotify3.t index c25c0f425..278755998 100644 --- a/t/inotify3.t +++ b/t/inotify3.t @@ -2,7 +2,18 @@ # Copyright (C) all contributors # License: AGPL-3.0+ use v5.12; use PublicInbox::TestCommon; +use Config; +use POSIX qw(uname); plan skip_all => 'inotify is Linux-only' if $^O ne 'linux'; +unless (eval { require PublicInbox::Inotify3 }) { + my (undef, undef, undef, undef, $machine) = uname(); + diag ''; + diag "\t$_" for (split /(?'; + diag "$_ => $Config{$_}" for qw(ptrsize sizesize); + plan skip_all => "inotify constants not defined on $machine"; +} + use_ok 'PublicInbox::Inotify3'; my $in = PublicInbox::Inotify3->new; my $tmpdir = tmpdir;