~ubuntu-branches/ubuntu/saucy/bioperl/saucy-proposed

« back to all changes in this revision

Viewing changes to t/Biblio_eutils.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# This is -*-Perl-*- code
2
 
## Bioperl Test Harness Script for Modules
3
 
##
4
 
# $Id: Biblio_eutils.t,v 1.2 2004/10/27 21:40:44 jason Exp $
5
 
 
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'
8
 
 
9
 
use strict;
10
 
use vars qw($NUMTESTS $DEBUG $error $msg);
11
 
 
12
 
BEGIN { 
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)
16
 
    # as a fallback
17
 
    eval { require Test; };
18
 
    $error = 0;
19
 
    if( $@ ) {
20
 
        use lib 't';
21
 
    }
22
 
    use Test;
23
 
    
24
 
    plan tests => ($NUMTESTS = 5);
25
 
    eval { require IO::String; };
26
 
    if( $@ ) {
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. ';
29
 
        $error = 1;
30
 
    } 
31
 
    eval { require LWP::Simple; };
32
 
    if( $@ ) {
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. ';
35
 
        $error = 1; 
36
 
    }
37
 
}
38
 
 
39
 
exit(0) if $error;
40
 
 
41
 
END { 
42
 
    foreach ( $Test::ntest..$NUMTESTS) {
43
 
        skip($msg,1);
44
 
    }
45
 
}
46
 
use Bio::Biblio;
47
 
 
48
 
## End of black magic.
49
 
##
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. 
53
 
 
54
 
my $db;
55
 
 
56
 
my $verbose =  $DEBUG || 0;
57
 
 
58
 
eval { 
59
 
    ok ($db = new Bio::Biblio (-access => 'eutils',
60
 
                               -verbose=>$verbose));
61
 
    ok(defined($db->find('"Day A"[AU] AND ("Database Management Systems"[MH] OR "Databases, Genetic"[MH] OR "Software"[MH] OR "Software Design"[MH])')));
62
 
};
63
 
 
64
 
if ($@) {
65
 
    warn "Warning: Couldn't connect to Eutils server!\n$@\n" if $DEBUG;
66
 
    $msg = 'No network access - could not connect to PubMed Eutils';
67
 
    exit(0);
68
 
}
69
 
 
70
 
while(my $xml = $db->get_next) {
71
 
    ok(1);
72
 
}