From 04657044bb3695d70298624eb25394fb864fb718 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 13 Sep 2021 20:53:50 +0000 Subject: tests: add require_cmd, require curl when needed 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. --- t/www_listing.t | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 't/www_listing.t') diff --git a/t/www_listing.t b/t/www_listing.t index 5f90139a..eb77969b 100644 --- a/t/www_listing.t +++ b/t/www_listing.t @@ -2,11 +2,7 @@ # Copyright (C) 2019-2021 all contributors # License: AGPL-3.0+ # manifest.js.gz generation and grok-pull integration test -use strict; -use v5.10.1; -use Test::More; -use PublicInbox::Spawn qw(which); -use PublicInbox::TestCommon; +use strict; use v5.10.1; use PublicInbox::TestCommon; use PublicInbox::Import; use IO::Uncompress::Gunzip qw(gunzip); require_mods(qw(json URI::Escape Plack::Builder Digest::SHA HTTP::Tiny)); @@ -134,7 +130,7 @@ SKIP: { tiny_test($json, $host, $port, 1); undef $sock; - my $grok_pull = which('grok-pull') or + my $grok_pull = require_cmd('grok-pull', 1) or skip('grok-pull not available', 12); my ($grok_version) = (xqx([$grok_pull, "--version"]) =~ /(\d+)\.(?:\d+)(?:\.(\d+))?/); -- cgit v1.2.3-24-ge0c7