1
# This is -*-Perl-*- code
2
## Bioperl Test Harness Script for Modules
4
# $Id: Biblio_eutils.t,v 1.2 2004/10/27 21:40:44 jason Exp $
6
# Before `make install' is performed this script should be runnable with
7
# `make test'. After `make install' it should work as `perl test.t'
10
use vars qw($NUMTESTS $DEBUG $error $msg);
13
$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
14
# to handle systems with no installed Test module
15
# we include the t dir (where a copy of Test.pm is located)
17
eval { require Test; };
24
plan tests => ($NUMTESTS = 5);
25
eval { require IO::String; };
27
warn( "IO::String not installed. This means the Bio::DB::* modules are not usable. Skipping tests.\n") if $DEBUG;
28
$msg .= 'IO::String not installed. ';
31
eval { require LWP::Simple; };
33
warn( "LWP::Simple not installed. This means the Bio::DB::* modules are not usable. Skipping tests.\n") if $DEBUG;
34
$msg .= 'LWP::Simple not installed. ';
42
foreach ( $Test::ntest..$NUMTESTS) {
48
## End of black magic.
50
## Insert additional test code below but remember to change
51
## the print "1..x\n" in the BEGIN block to reflect the
52
## total number of tests that will be run.
56
my $verbose = $DEBUG || 0;
59
ok ($db = new Bio::Biblio (-access => 'eutils',
61
ok(defined($db->find('"Day A"[AU] AND ("Database Management Systems"[MH] OR "Databases, Genetic"[MH] OR "Software"[MH] OR "Software Design"[MH])')));
65
warn "Warning: Couldn't connect to Eutils server!\n$@\n" if $DEBUG;
66
$msg = 'No network access - could not connect to PubMed Eutils';
70
while(my $xml = $db->get_next) {