X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=videosite.git;a=blobdiff_plain;f=videosite-test.pl;h=1f3d146a11734f103a7d4b676ab02c882f005ad6;hp=bfea2f2622c5018899c3cef917d3393b2a7f2c14;hb=01fc17a9fd2a11cd5826a2581fe662e96ac5912c;hpb=d4d4499785270dde16ac6da79d39b20951b5c956 diff --git a/videosite-test.pl b/videosite-test.pl index bfea2f2..1f3d146 100755 --- a/videosite-test.pl +++ b/videosite-test.pl @@ -6,6 +6,9 @@ use File::Spec; use File::Basename; use Module::Load; use Cwd qw(realpath); +use Carp; + +$SIG{ __DIE__ } = sub { Carp::confess( @_ ) }; my $debug = 0; my %config = ( @@ -32,11 +35,23 @@ unless(libvideosite::init()) { select(STDOUT); $| = 1; printf("Doing self tests:\n"); -foreach (libvideosite::_grabbers()) { +foreach my $g (libvideosite::_grabbers()) { my $r; - printf(" %s...", $_->{'NAME'}); - $r = $_->_selftest(); + if (@ARGV) { + my $found; + + # If there are grabber names given on the command line check + # the current name against that list and skip if not present + $found = grep { $_ eq $g->{'NAME'} } @ARGV; + + if ($found == 0) { + next; + } + } + + printf(" %s...", $g->{'NAME'}); + $r = $g->_selftest(); if(defined($r)) { if ($r == 1) { printf(" OK\n");