]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
t/inotify3: fail gracefully on unsupported arches
authorEric Wong <e@80x24.org>
Mon, 19 Aug 2024 20:46:36 +0000 (20:46 +0000)
committerEric Wong <e@80x24.org>
Tue, 20 Aug 2024 10:33:25 +0000 (10:33 +0000)
New architectures will inevitably appear or lose support,
so ensure we fail gracefully here with some hopefully
helpful messages.

t/inotify3.t

index c25c0f4251443295f749d40663bcf37aa1fc33ea..278755998a160e15a18b29702d7874ffa1c4fdc5 100644 (file)
@@ -2,7 +2,18 @@
 # Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 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 '<cppsymbols>';
+       diag "\t$_" for (split /(?<!\\)\s+/, $Config{cppsymbols});
+       diag '</cppsymbols>';
+       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;