use File::Basename;
use Module::Load;
use Cwd qw(realpath);
+use Carp;
+
+$SIG{ __DIE__ } = sub { Carp::confess( @_ ) };
my $debug = 0;
my %config = (
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");