From 8a0765262c5bde9b8343b14e7c7fdbf8cf8c94fe Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 12 Sep 2025 21:28:49 +0000 Subject: [PATCH] t/httpd-corner: fix test on missing curl-config(1) We were misusing our internal context-dependent `require_cmd', which requires the caller to call `skip' explicitly when a return value is desired. So add a new `skip' call for testers without curl-config(1). Furthermore, the `SKIP' label was incorrectly placed for Test::More::skip to use, so create an explicit block for it. Reported-by: Jonathan Corbet Link: https://public-inbox.org/meta/878qikobes.fsf@trenco.lwn.net/ --- t/httpd-corner.t | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/t/httpd-corner.t b/t/httpd-corner.t index cf67ad28b..ac40a7087 100644 --- a/t/httpd-corner.t +++ b/t/httpd-corner.t @@ -231,8 +231,10 @@ if ('test rejected trailers') { # I don't trust myself to read RFCs properly and need a 3rd-party client: my $tup = "t/trailer-up-$Config{archname}"; my @tup_h_st = stat 't/trailer-up.h' or die "stat('t/trailer-up.h'): $!"; -SKIP: if (!-e $tup || (stat(_))[10] < $tup_h_st[10]) { - my $curl_config = require_cmd 'curl-config', 1; +SKIP: { +if (!-e $tup || (stat(_))[10] < $tup_h_st[10]) { + my $curl_config = require_cmd('curl-config', 1) or + skip 'curl-config missing', 1; my %ccfg; for my $f (qw(version cc cflags libs)) { chomp($ccfg{$f} = xqx [ $curl_config, "--$f" ]); @@ -251,6 +253,7 @@ SKIP: if (!-e $tup || (stat(_))[10] < $tup_h_st[10]) { xsys(\@build) and skip "@build failed: \$?=$?", 1; rename "$tup.$<.$$.tmp", $tup; stat $tup; # for _ below: +} } # SKIP if (-x _) { my %opt = (0 => \'i', 1 => \(my $o = ''), 2 => \(my $e = '')); -- 2.47.3