From 849703c4b5101f2614b20b401241662b43111912 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 19 Aug 2024 20:46:36 +0000 Subject: [PATCH] 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. --- t/inotify3.t | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; -- 2.47.2