X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=videosite.git;a=blobdiff_plain;f=videosite-test.pl;h=422a9fceb134dc49897a3960f32533a1e4c44e7e;hp=bfea2f2622c5018899c3cef917d3393b2a7f2c14;hb=HEAD;hpb=d4d4499785270dde16ac6da79d39b20951b5c956 diff --git a/videosite-test.pl b/videosite-test.pl index bfea2f2..422a9fc 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 = ( @@ -16,6 +19,8 @@ my $success = 0; my $fail = 0; my $notest = 0; +GetOptions("d" => \$debug); + push(@INC, dirname(realpath($0))); load 'libvideosite'; @@ -32,11 +37,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");