From 11683399d861aa6bac9b0d7bf1c754de4302fece Mon Sep 17 00:00:00 2001 From: Ralf Ertzinger Date: Tue, 30 Apr 2013 20:58:47 +0200 Subject: [PATCH] videosite-test: Allow selective tests by using grabber names on the command line --- videosite-test.pl | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/videosite-test.pl b/videosite-test.pl index bfea2f2..0d9e771 100755 --- a/videosite-test.pl +++ b/videosite-test.pl @@ -32,11 +32,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"); -- 1.8.3.1