about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-21 03:22:50 +0000
committerEric Wong <e@yhbt.net>2020-04-21 20:13:50 +0000
commitf1e0136491b6cb1ab7ca432eb051a880d788f5ad (patch)
treefb8903f57a8616d47119dc2a04c907a4b4c05b37
parentfb8e7dbd1b711d25d1033c3f5f540ce47f6c0849 (diff)
downloadpublic-inbox-f1e0136491b6cb1ab7ca432eb051a880d788f5ad.tar.gz
The `xqx' sub requires an absolute path for optional
commands.

Fixes: 6e07def560b211d9 ("testcommon: spawn-aware system() and qx[] workalikes")
-rw-r--r--t/nntpd.t4
1 files changed, 3 insertions, 1 deletions
diff --git a/t/nntpd.t b/t/nntpd.t
index 66aa48f1..b2ef575d 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -4,6 +4,7 @@ use strict;
 use warnings;
 use Test::More;
 use PublicInbox::TestCommon;
+use PublicInbox::Spawn qw(which);
 require_mods(qw(DBD::SQLite));
 require PublicInbox::SearchIdx;
 require PublicInbox::Msgmap;
@@ -304,8 +305,9 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000
                 if ($INC{'Search/Xapian.pm'} && ($ENV{TEST_RUN_MODE}//2)) {
                         skip 'Search/Xapian.pm pre-loaded (by t/run.perl?)', 1;
                 }
+                my $lsof = which('lsof') or skip 'lsof missing', 1;
                 my $rdr = { 2 => \(my $null) };
-                my @of = xqx(['lsof', '-p', $td->{pid}], undef, $rdr);
+                my @of = xqx([$lsof, '-p', $td->{pid}], undef, $rdr);
                 skip('lsof broken', 1) if (!scalar(@of) || $?);
                 my @xap = grep m!Search/Xapian!, @of;
                 is_deeply(\@xap, [], 'Xapian not loaded in nntpd');