diff options
author | Eric Wong <e@80x24.org> | 2023-01-30 22:50:07 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-01-31 00:27:05 +0000 |
commit | 5dbb060037ce3e3a3ba0812baa90c80eeee762af (patch) | |
tree | 4c61aef7f5822ede45c8c352320ed8bc5b7492b8 /xt/imapd-mbsync-oimap.t | |
parent | 155ee9cdaffd6232ef3c774d1a9f61d708fc8d6e (diff) | |
download | public-inbox-5dbb060037ce3e3a3ba0812baa90c80eeee762af.tar.gz |
We'll rely on defined(wantarray) to implicitly skip subtests, and memoize these to reduce syscalls, since tests should be short-lived enough to not be affected by new installations or removals of git/xapian-compact/curl/etc...
Diffstat (limited to 'xt/imapd-mbsync-oimap.t')
-rw-r--r-- | xt/imapd-mbsync-oimap.t | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/xt/imapd-mbsync-oimap.t b/xt/imapd-mbsync-oimap.t index 0baf5b4c..b0281105 100644 --- a/xt/imapd-mbsync-oimap.t +++ b/xt/imapd-mbsync-oimap.t @@ -1,12 +1,12 @@ #!perl -w -# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org> +# Copyright (C) all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> # ensure mbsync and offlineimap compatibility use strict; use v5.10.1; use File::Path qw(mkpath); use PublicInbox::TestCommon; -use PublicInbox::Spawn qw(which spawn); +use PublicInbox::Spawn qw(spawn); require_mods(qw(-imapd)); my $inboxdir = $ENV{GIANT_INBOX_DIR}; (defined($inboxdir) && -d $inboxdir) or @@ -42,7 +42,8 @@ my %pids; SKIP: { mkpath([map { "$tmpdir/oimapdir/$_" } qw(cur new tmp)]); - my $oimap = which('offlineimap') or skip 'no offlineimap(1)', 1; + my $oimap = require_cmd('offlineimap', 1) or + skip 'no offlineimap(1)', 1; open my $fh, '>', "$tmpdir/.offlineimaprc" or BAIL_OUT "open: $!"; print $fh <<EOF or BAIL_OUT "print: $!"; [general] @@ -78,7 +79,7 @@ EOF SKIP: { mkpath([map { "$tmpdir/mbsyncdir/test/$_" } qw(cur new tmp)]); - my $mbsync = which('mbsync') or skip 'no mbsync(1)', 1; + my $mbsync = require_cmd('mbsync', 1) or skip 'no mbsync(1)', 1; open my $fh, '>', "$tmpdir/.mbsyncrc" or BAIL_OUT "open: $!"; print $fh <<EOF or BAIL_OUT "print: $!"; Create Slave |