Tweak sample command-line
[irspy-moved-to-github.git] / bin / irspy.pl
1 #!/usr/bin/perl -w
2
3 # $Id: irspy.pl,v 1.10 2006-10-06 11:25:11 mike Exp $
4 #
5 # Run like this:
6 #       YAZ_LOG=irspy,irspy_test,irspy_debug,irspy_event perl -I ../lib irspy.pl localhost:3313/IR-Explain---1 bagel.indexdata.dk/gils z3950.loc.gov:7090/Voyager bagel.indexdata.dk:210/marc 
7
8 use strict;
9 use warnings;
10 use Getopt::Std;
11 use ZOOM::IRSpy;
12
13 my %opts;
14 if (!getopts('t:', \%opts) || @ARGV < 1) {
15     print STDERR "\
16 Usage $0: [options] <IRSpy-database> [<target> ...]
17 If no targets are specified, all targets in DB are tested.
18         -t <test>       Run the specified <test> [default: all tests]
19 ";
20     exit 1;
21 }
22
23 my($dbname, @targets) = @ARGV;
24 my $spy = new ZOOM::IRSpy($dbname, "admin", "fruitbat");
25 $spy->targets(@targets) if @targets;
26 $spy->initialise();
27 my $res = $spy->check($opts{t});
28 if ($res == 0) {
29     print "All tests were run\n";
30 } else {
31     print "Some tests were skipped\n";
32 }