projects
/
irspy-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Test of all targets now requires explicit -a option, so it can't be
[irspy-moved-to-github.git]
/
bin
/
irspy.pl
diff --git
a/bin/irspy.pl
b/bin/irspy.pl
index
b84f1ae
..
d7fda06
100755
(executable)
--- a/
bin/irspy.pl
+++ b/
bin/irspy.pl
@@
-1,9
+1,9
@@
#!/usr/bin/perl -w
#!/usr/bin/perl -w
-# $Id: irspy.pl,v 1.16 2006-11-18 00:10:44 mike Exp $
+# $Id: irspy.pl,v 1.22 2007-02-23 16:44:50 mike Exp $
#
# Run like this:
#
# Run like this:
-# YAZ_LOG=irspy,irspy_task perl -I ../lib irspy.pl -t Quick localhost:3313/IR-Explain---1 bagel.indexdata.dk/gils z3950.loc.gov:7090/Voyager bagel.indexdata.dk:210/marc
+# YAZ_LOG=irspy,irspy_test IRSPY_SAVE_XML=1 perl -I../lib irspy.pl -t Quick localhost:8018/IR-Explain---1 z3950.loc.gov:7090/Voyager bagel.indexdata.dk/gils bagel.indexdata.dk:210/marc
# Available log-levels are as follows:
# irspy -- high-level application logging
# irspy_debug -- low-level debugging (not very interesting)
# Available log-levels are as follows:
# irspy -- high-level application logging
# irspy_debug -- low-level debugging (not very interesting)
@@
-18,12
+18,13
@@
use Getopt::Std;
use ZOOM::IRSpy::Web;
my %opts;
use ZOOM::IRSpy::Web;
my %opts;
-if (!getopts('wt:', \%opts) || @ARGV < 1) {
+if (!getopts('wt:af:', \%opts) || @ARGV < 1) {
print STDERR "\
Usage $0: [options] <IRSpy-database> [<target> ...]
print STDERR "\
Usage $0: [options] <IRSpy-database> [<target> ...]
-If no targets are specified, all targets in DB are tested.
-w Use ZOOM::IRSpy::Web subclass
-t <test> Run the specified <test> [default: all tests]
-w Use ZOOM::IRSpy::Web subclass
-t <test> Run the specified <test> [default: all tests]
+ -a Test all targets (slow!)
+ -f <query> Test targets found by the specified query
";
exit 1;
}
";
exit 1;
}
@@
-33,11
+34,19
@@
my $class = "ZOOM::IRSpy";
$class .= "::Web" if $opts{w};
my $spy = $class->new($dbname, "admin", "fruitbat");
$class .= "::Web" if $opts{w};
my $spy = $class->new($dbname, "admin", "fruitbat");
-$spy->targets(@targets) if @targets;
+if (@targets) {
+ $spy->targets(@targets);
+} elsif ($opts{f}) {
+ $spy->find_targets($opts{f});
+} elsif (!$opts{a}) {
+ print STDERR "$0: specify -a, -f <query> or list of targets\n";
+ exit 1;
+}
+
$spy->initialise();
my $res = $spy->check($opts{t});
if ($res == 0) {
$spy->initialise();
my $res = $spy->check($opts{t});
if ($res == 0) {
- print "All tests were run\n";
+ print "All tests were attempted\n";
} else {
print "$res tests were skipped\n";
}
} else {
print "$res tests were skipped\n";
}