comparison lib/Test/Nginx.pm @ 1963:5656138f2e46

Tests: improved has_daemon() to drop "which" stderr. On some platforms (notably OpenBSD) "which" prints an error if the command is not found. It is now dropped to produce less clutter during testing.
author Maxim Dounin <mdounin@mdounin.ru>
date Sun, 05 May 2024 23:56:16 +0300
parents 1d980c5013dc
children 6d3a8f4eb9b2
comparison
equal deleted inserted replaced
1962:f1ba89f735ba 1963:5656138f2e46
334 unless `command -v $daemon`; 334 unless `command -v $daemon`;
335 return $self; 335 return $self;
336 } 336 }
337 337
338 Test::More::plan(skip_all => "$daemon not found") 338 Test::More::plan(skip_all => "$daemon not found")
339 unless `which $daemon`; 339 unless `which $daemon 2>/dev/null`;
340 340
341 return $self; 341 return $self;
342 } 342 }
343 343
344 sub try_run($$) { 344 sub try_run($$) {