about summary refs log tree commit homepage
path: root/t/nodatacow.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-09-13 20:53:50 +0000
committerEric Wong <e@80x24.org>2021-09-13 21:11:13 +0000
commit04657044bb3695d70298624eb25394fb864fb718 (patch)
treefce610c4e7c2b3a7287d9a3cbde42bfc2ff36bfa /t/nodatacow.t
parentdc489bfd4b4c659b7ebb166ab540b4e767e51aaa (diff)
downloadpublic-inbox-04657044bb3695d70298624eb25394fb864fb718.tar.gz
t/v2mirror.t and t/lei-mirror.t are now skipped when curl
is missing (instead of failing in appropriate places).
A bunch of which() checks are updated to use require_cmd
to avoid explicitly loading Spawn.
Diffstat (limited to 't/nodatacow.t')
-rw-r--r--t/nodatacow.t10
1 files changed, 4 insertions, 6 deletions
diff --git a/t/nodatacow.t b/t/nodatacow.t
index 9b67c521..19247c10 100644
--- a/t/nodatacow.t
+++ b/t/nodatacow.t
@@ -1,11 +1,8 @@
 #!perl -w
 # Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
-use strict;
-use Test::More;
+use strict; use v5.10.1; use PublicInbox::TestCommon;
 use File::Temp 0.19;
-use PublicInbox::TestCommon;
-use PublicInbox::Spawn qw(which);
 use_ok 'PublicInbox::NDC_PP';
 
 SKIP: {
@@ -13,8 +10,9 @@ SKIP: {
         skip 'test is Linux-only', $nr if $^O ne 'linux';
         my $dir = $ENV{BTRFS_TESTDIR};
         skip 'BTRFS_TESTDIR not defined', $nr unless defined $dir;
-        skip 'chattr(1) not installed', $nr unless which('chattr');
-        my $lsattr = which('lsattr') or skip 'lsattr(1) not installed', $nr;
+        require_cmd('chattr', 1) or skip 'chattr(1) not installed', $nr;
+        my $lsattr = require_cmd('lsattr', 1) or
+                skip 'lsattr(1) not installed', $nr;
         my $tmp = File::Temp->newdir('nodatacow-XXXX', DIR => $dir);
         my $dn = $tmp->dirname;