X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FTestCommon.pm;h=ecf7a261b6f485447dce78ca6f10fd74660f4201;hb=23af251dd607c4e75ab1e68063f2c885c48cc035;hp=ca7328111dcc47dc974aa3d3e5e83549130f111c;hpb=303c3507b4aefc0e08d792de02357ea9ab0fc322;p=public-inbox.git
diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm
index ca732811..ecf7a261 100644
--- a/lib/PublicInbox/TestCommon.pm
+++ b/lib/PublicInbox/TestCommon.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2021 all contributors
+# Copyright (C) all contributors
# License: AGPL-3.0+
# internal APIs used only for tests
@@ -19,7 +19,8 @@ BEGIN {
run_script start_script key2sub xsys xsys_e xqx eml_load tick
have_xapian_compact json_utf8 setup_public_inboxes create_inbox
tcp_host_port test_lei lei lei_ok $lei_out $lei_err $lei_opt
- test_httpd xbail require_cmd is_xdeeply tail_f);
+ test_httpd xbail require_cmd is_xdeeply tail_f
+ ignore_inline_c_missing);
require Test::More;
my @methods = grep(!/\W/, @Test::More::EXPORT);
eval(join('', map { "*$_=\\&Test::More::$_;" } @methods));
@@ -377,7 +378,7 @@ sub wait_for_tail {
my @ino;
do {
@ino = grep {
- readlink($_) =~ /\binotify\b/
+ (readlink($_) // '') =~ /\binotify\b/
} glob("/proc/$tail_pid/fd/*");
} while (!@ino && time <= $end and tick);
return if !@ino;
@@ -547,6 +548,11 @@ sub is_xdeeply ($$$) {
$ok;
}
+sub ignore_inline_c_missing {
+ $_[0] = join('', grep(/\S/, grep(!/compilation aborted/,
+ grep(!/\bInline\b/, split(/^/m, $_[0])))));
+}
+
sub test_lei {
SKIP: {
my ($cb) = pop @_;
@@ -571,8 +577,10 @@ SKIP: {
$ENV{LANG} = $ENV{LC_ALL} = 'C';
my (undef, $fn, $lineno) = caller(0);
my $t = "$fn:$lineno";
- state $lei_daemon = PublicInbox::Spawn->can('send_cmd4') ||
- eval { require Socket::MsgHdr; 1 };
+ state $lei_daemon = PublicInbox::Spawn->can('send_cmd4') || do {
+ require PublicInbox::Syscall;
+ PublicInbox::Syscall->can('send_cmd4');
+ } || eval { require Socket::MsgHdr; 1 };
unless ($lei_daemon) {
skip('Inline::C unconfigured/missing '.
'(mkdir -p ~/.cache/public-inbox/inline-c) OR Socket::MsgHdr missing',