1 # This is -*-Perl-*- code
2 ## Bioperl Test Harness Script for Modules
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 lib '..','.','./blib/lib';
11 use vars qw($NUMTESTS $DEBUG);
12 $DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
17 # to handle systems with no installed Test module
18 # we include the t dir (where a copy of Test.pm is located)
20 eval { require Test; };
28 plan tests => $NUMTESTS;
30 eval { require IO::String;
31 require LWP::UserAgent;
32 require HTTP::Request::Common;
35 print STDERR "IO::String or LWP::UserAgent or HTTP::Request not installed. This means the Bio::DB::* modules are not usable. Skipping tests.\n";
37 skip("IO::String, LWP::UserAgent,or HTTP::Request not installed",1);
44 foreach ( $Test::ntest..$NUMTESTS) {
45 skip('Unable to run all of the DB tests',1);
55 require Bio::DB::GenBank;
56 require Bio::DB::GenPept;
57 require Bio::DB::SwissProt;
58 require Bio::DB::RefSeq;
59 require Bio::DB::EMBL;
60 require Bio::DB::BioFetch;
63 $verbose = 0 if $DEBUG;
66 my ($id, $class) = @_;
67 print "###################### $class ####################################\n" if $DEBUG;
69 ok defined ( my $gb = new $class('-verbose'=>$verbose,'-delay'=>0) );
70 eval { $seq = $gb->get_Seq_by_id($id) };
71 if( $@ or not defined$seq ) {
78 my @classes = qw( Bio::DB::BioFetch Bio::DB::GenBank Bio::DB::GenPept
79 Bio::DB::SwissProt Bio::DB::RefSeq Bio::DB::EMBL );
81 my $id = 'XXX111'; # nonsense id