summaryrefslogtreecommitdiffstats
path: root/t/helper.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2020-01-07 14:06:19 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2020-01-07 14:53:51 +0100
commit67460c77acc847ab1ee92d0cd20f4f9889c5f906 (patch)
tree645cf2a8c2b259f07351a5f6607603e2d57d38d6 /t/helper.pm
parent2d1f003ce467fc0ac7cfc997b46ea67b67953383 (diff)
downloadurpmi-67460c77acc847ab1ee92d0cd20f4f9889c5f906.tar
urpmi-67460c77acc847ab1ee92d0cd20f4f9889c5f906.tar.gz
urpmi-67460c77acc847ab1ee92d0cd20f4f9889c5f906.tar.bz2
urpmi-67460c77acc847ab1ee92d0cd20f4f9889c5f906.tar.xz
urpmi-67460c77acc847ab1ee92d0cd20f4f9889c5f906.zip
(need_downloader) split it for next commit
also switching one character back from UTF to ASCII
Diffstat (limited to 't/helper.pm')
-rw-r--r--t/helper.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/t/helper.pm b/t/helper.pm
index 6057a825..8cfdb35d 100644
--- a/t/helper.pm
+++ b/t/helper.pm
@@ -2,7 +2,7 @@ package helper;
use Test::More;
use base 'Exporter';
-our @EXPORT = qw(need_root_and_prepare
+our @EXPORT = qw(need_root_and_prepare need_downloader
start_httpd httpd_port
urpmi_addmedia urpmi_removemedia urpmi_update
urpm_cmd run_urpm_cmd urpmi_cmd urpmi urpmi_partial test_urpmi_fail urpme
@@ -29,6 +29,20 @@ sub need_root_and_prepare() {
$ENV{LC_ALL} = 'C';
}
+sub need_downloader() {
+ my @dl_helpers = qw(wget curl prozilla aria2c);
+ my $found;
+ foreach (@dl_helpers) {
+ -e "/bin/$_" and $found = 1;
+ }
+ if (!$found) {
+ warn "SKIPing because we're missing a downloader. We need one of wget/curl/prozilla/aria2c";
+ #plan skip_all => "*BSD fails those";
+ exit 0;
+ }
+}
+
+
my $server_pid;
sub httpd_port() { 6969 }
sub start_httpd() {