From 9cc34eb72f244e832ae9c4af1d1f1654ab60c989 Mon Sep 17 00:00:00 2001 From: Graham McVicker <mcvicker@sanger.ac.uk> Date: Fri, 23 Jul 2004 09:57:20 +0000 Subject: [PATCH] updated tests to use centralised ensembl-test framework --- modules/runtests.pl | 123 --- ...tiTestDB.conf => MultiTestDB.conf.example} | 9 +- modules/t/MultiTestDB.pm | 705 ------------------ modules/t/MultiTestDB.t | 5 +- modules/t/README | 39 +- modules/t/analysis.t | 5 +- modules/t/archiveStableId.t | 7 +- modules/t/argument.t | 3 +- modules/t/assemblyException.t | 7 +- modules/t/assemblyExceptionFeature.t | 7 +- modules/t/assemblyMapper.t | 7 +- modules/t/attribute.t | 5 +- modules/t/attributeAdaptor.t | 7 +- modules/t/canonicalDBAdaptor.t | 9 +- modules/t/chainedAssemblyMapper.t | 7 +- modules/t/chromosome.t | 7 +- modules/t/clone.t | 5 +- modules/t/compressedSequenceAdaptor.t | 7 +- modules/t/container.t | 1 - modules/t/coordSystem.t | 3 +- modules/t/coordSystemAdaptor.t | 7 +- modules/t/dbConnection.t | 7 +- modules/t/dbEntries.t | 7 +- modules/t/densityFeature.t | 9 +- modules/t/densityFeatureAdaptor.t | 7 +- modules/t/densityType.t | 7 +- modules/t/densityTypeAdaptor.t | 7 +- modules/t/dnaAlignFeatureAdaptor.t | 7 +- modules/t/dnaDnaAlignFeature.t | 5 +- modules/t/dnaPepAlignFeature.t | 7 +- modules/t/easyargv.t | 1 - modules/t/exception.t | 3 +- modules/t/exon.t | 7 +- modules/t/externalFeatureAdaptor.t | 9 +- modules/t/feature.t | 7 +- modules/t/featurePair.t | 5 +- modules/t/gene.t | 7 +- modules/t/geneview.t | 7 +- modules/t/intron.t | 7 +- modules/t/karyotypeBand.t | 3 +- modules/t/karyotypeBandAdaptor.t | 7 +- modules/t/mapLocation.t | 7 +- modules/t/mapper.t | 1 - modules/t/marker.t | 7 +- modules/t/markerAdaptor.t | 7 +- modules/t/markerFeature.t | 7 +- modules/t/markerFeatureAdaptor.t | 7 +- modules/t/markerSynonym.t | 3 +- modules/t/metaContainer.t | 7 +- modules/t/metaCoordContainer.t | 7 +- modules/t/miscFeature.t | 5 +- modules/t/miscFeatureAdaptor.t | 7 +- modules/t/miscSet.t | 3 +- modules/t/miscSetAdaptor.t | 7 +- modules/t/predictionTranscript.t | 19 +- modules/t/proteinAlignFeatureAdaptor.t | 7 +- modules/t/proteinFeature.t | 3 +- modules/t/proteinFeatureAdaptor.t | 7 +- modules/t/qtl.t | 7 +- modules/t/rangeRegistry.t | 3 +- modules/t/rawContig.t | 7 +- modules/t/rawContigAdaptor.t | 7 +- modules/t/repeatConsensus.t | 3 +- modules/t/repeatConsensusAdaptor.t | 7 +- modules/t/repeatFeature.t | 3 +- modules/t/repeatFeatureAdaptor.t | 7 +- modules/t/repeatMaskedSlice.t | 7 +- modules/t/seqDumper.t | 7 +- modules/t/seqEdit.t | 3 +- modules/t/sequenceAdaptor.t | 7 +- modules/t/simpleFeature.t | 7 +- modules/t/slice.t | 7 +- modules/t/sliceAdaptor.t | 7 +- modules/t/topLevelAssemblyMapper.t | 7 +- modules/t/transcript.t | 7 +- modules/t/translation.t | 7 +- 76 files changed, 218 insertions(+), 1104 deletions(-) delete mode 100755 modules/runtests.pl rename modules/t/{MultiTestDB.conf => MultiTestDB.conf.example} (56%) delete mode 100644 modules/t/MultiTestDB.pm diff --git a/modules/runtests.pl b/modules/runtests.pl deleted file mode 100755 index 7deb9afe2e..0000000000 --- a/modules/runtests.pl +++ /dev/null @@ -1,123 +0,0 @@ -use strict; -use warnings; - -use lib 't'; - -use Getopt::Std; -use Test::Harness; -use MultiTestDB; - -use vars qw($opt_l $opt_h); - -#read command line options -&usage unless getopts('lh'); - -#print usage on '-h' command line option -if($opt_h) { - &usage; - exit; -} - -#list test files on '-l' command line option -if($opt_l) { - foreach my $file (map {s{^\./}{}; $_} @{get_all_tests('.', \@ARGV)}) { - print "$file\n"; - } - exit; -} - - -#set environment var -$ENV{'RUNTESTS_HARNESS'} = 1; - -#make sure proper cleanup is done if the user interrupts the tests -$SIG{HUP} = $SIG{KILL} = $SIG{INT} = - sub {warn "\n\nINTERRUPT SIGNAL RECEIEVED\n\n"; &clean;}; - -#create a multitest db, its destruction will clean up after scripts -my $clean_up = new MultiTestDB; - -#run all specified tests -eval { - runtests(@{&get_all_tests('.', \@ARGV)}); -}; - -&clean; - -sub clean { - #unset env var indicating final cleanup should be performed - delete $ENV{"RUNTESTS_HARNESS"}; - exit; -} - -=head2 get_all_tests - - Arg [1] : string $dir - the name of the directory retrieve a list of tests from - Arg [2] : (optional) listref $input_files - testfiles or directories to retrieve. If not specified all - ".t" files in $dir are taken. - Example : @test_files = read_test_dir('t'); - Description: Returns a list of testfiles in the directories specified by - the @tests argument. The relative path is given as well as - with the testnames returned. Only files ending with .t are - returned. Subdirectories are recursively entered and the test - files returned within them are returned as well. - Returntype : listref of strings. - Exceptions : none - Caller : general - -=cut - -sub get_all_tests { - my ($dir, $input_files) = @_; - - my @files; - my @out = (); - local *DIR; - - unless(opendir(DIR, $dir)) { - warn("WARNING: cannot open directory $dir\n"); - return []; - } - - if($input_files && @$input_files) { - #input files were specified so use them - @files = @$input_files; - } else { - #otherwise use every file in the directory - @files = readdir DIR; - } - - #filter out CVS files, files beginning with '.' and files ending in ~ - @files = grep !/(^\.)|(^CVS$)|(~$)/, @files; - - foreach my $file (@files) { - $file = "$dir/$file"; - - if(-d $file) { - #do a recursive call on directories - push @out, @{get_all_tests("$file")}; - } elsif ($file =~ /\.t$/) { - #files ending with a '.t' are considered test files - unless(-r $file && -f $file) { - warn("WARNING: cannot read test file $file\n"); - } - push @out, $file; - } - } - - closedir DIR; - - return \@out; -} - - - -sub usage { - print "usage:\n"; - print "\tlist tests: run_tests.pl -l [<testfiles or dirs> ...]\n"; - print "\trun tests: run_tests.pl [<testfiles or dirs> ...]\n"; -} - - diff --git a/modules/t/MultiTestDB.conf b/modules/t/MultiTestDB.conf.example similarity index 56% rename from modules/t/MultiTestDB.conf rename to modules/t/MultiTestDB.conf.example index 40d4e03076..71763cc746 100644 --- a/modules/t/MultiTestDB.conf +++ b/modules/t/MultiTestDB.conf.example @@ -5,11 +5,14 @@ 'pass' => 'ensembl', 'host' => 'ecs1d', 'zip' => 'test_genome.zip', - #add a line with the dbname and module - 'databases' => { 'core' => 'Bio::EnsEMBL::DBSQL::DBAdaptor'}, + 'databases' => { + 'homo_sapiens' => {'core' => 'Bio::EnsEMBL::DBSQL::DBAdaptor'} + } #uncomment to use preloaded databases (useful when doing lots of testing) -# 'preloaded' => { 'core' => 'mcvicker_new_schema' } +# ,'preloaded' => { +# 'homo_sapiens' => {'core' => 'mcvicker_new_schema' } +# } } diff --git a/modules/t/MultiTestDB.pm b/modules/t/MultiTestDB.pm deleted file mode 100644 index 7bbe143714..0000000000 --- a/modules/t/MultiTestDB.pm +++ /dev/null @@ -1,705 +0,0 @@ - - -=pod - -=head1 NAME - EnsTestDB - -=head1 SYNOPSIS - -=head1 DESCRIPTION - - -=head1 METHODS - -=cut - -package MultiTestDB; - -use vars qw(%ENV); - -use Bio::EnsEMBL::Utils::Exception qw(throw warning); - -use strict; - -use DBI; -use Data::Dumper; - - -#homo sapiens is used if no species is specified -my $DEFAULT_SPECIES = 'homo_sapiens'; - -#configuration file extension appended onto species name -my $FROZEN_CONF_EXT = '.MultiTestDB.frozen.conf'; - -my $CONF_FILE = 'MultiTestDB.conf'; - -my $DUMP_DIR = 'test-genome-DBs'; - -sub new { - my( $pkg, $species ) = @_; - - my $self = bless {}, $pkg; - - # go and grab the current directory and store it away - my $curr_dir = $ENV{'PWD'} . "/".__FILE__; - $curr_dir =~ s/MultiTestDB.pm$//; - - $self->curr_dir($curr_dir); - - unless($species) { - $species = $DEFAULT_SPECIES; - } - - $self->species($species); - - - if ( -e $self->curr_dir . $species . $FROZEN_CONF_EXT) { - $self->load_config; - } - else { - #load the databases and generate the conf hash - $self->load_databases; - - #freeze configuration in a file - $self->store_config; - } - - - #generate the db_adaptors from the $self->{'conf'} hash - $self->create_adaptors; - - return $self; -} - - -# -# load config into $self->{'conf'} hash -# -sub load_config { - my $self = shift; - - my $conf = $self->curr_dir . $self->species . $FROZEN_CONF_EXT; - - eval { - $self->{'conf'} = do $conf; #reads file into $self->{'conf'} - }; - - if($@) { - die("Could not read frozen configuration file '$conf'\n"); - } -} - - - -# -# Store $self->{'config'} hash into a file -# -sub store_config { - my $self = shift; - - my $conf = $self->curr_dir . $self->species . $FROZEN_CONF_EXT; - - local *FILE; - - open(FILE, ">$conf") or die "Could not open config file ".$conf."\n"; - - my $string = Dumper($self->{'conf'}); - - #strip off leading '$VAR1 = ' - $string =~ s/^[\$]VAR1\s*=//; - - #store config in file - print FILE $string; - - close FILE; -} - - - -#create a set of adaptors based on the $self->{'conf'} hash -sub create_adaptors { - my $self = shift; - - #establish a connection to each of the databases in the configuration - foreach my $dbtype (keys %{$self->{'conf'}}) { - - my $db = $self->{'conf'}->{$dbtype}; - my $adaptor; - my $module = $db->{'module'}; - - #try to instantiate an adaptor for this database - eval { - - # require needs /'s rather than colons - if ( $module =~ /::/ ) { - $module =~ s/::/\//g; - } - require "${module}.pm"; - - # but switch back for the new instantiation - $module =~ s/\//::/g; - - $adaptor = $module->new(-dbname => $db->{'dbname'}, - -user => $db->{'user'}, - -pass => $db->{'pass'}, - -port => $db->{'port'}, - -host => $db->{'host'}, - -driver => $db->{'driver'}); - }; - - if ($@) { - warning("WARNING: Could not instantiate $dbtype DBAdaptor:\n$@"); - } else { - $self->{'db_adaptors'}->{$dbtype} = $adaptor; - } - } -} - - - - - -sub load_databases { - my ($self) = shift; - - print STDERR "\nTrying to load [$self->{'species'}] databases\n"; - - #create database from conf and from zip files - my $db_conf = do $self->curr_dir . $CONF_FILE; - - my $port = $db_conf->{'port'}; - my $driver = $db_conf->{'driver'}; - my $host = $db_conf->{'host'}; - my $pass = $db_conf->{'pass'}; - my $user = $db_conf->{'user'}; - my $zip = $db_conf->{'zip'}; - - #create a config hash which will be frozen to a file - $self->{'conf'} = {}; - - #connect to the database - my $locator = "DBI:".$driver.":host=".$host.";port=".$port; - my $db = DBI->connect($locator, $user, $pass, {RaiseError => 1}); - - unless($db) { - warning("Can't connect to database $locator"); - return; - } - - #only unzip if there are non-preloaded datbases - UNZIP: foreach my $dbtype (keys %{$db_conf->{'databases'}}) { - if (( ! exists $db_conf->{'preloaded'}->{$dbtype} ) || - ( ! _db_exists( $db, $db_conf->{'preloaded'}{$dbtype}) )) { - #unzip database files - $self->unzip_test_dbs($self->curr_dir . $zip); - last UNZIP; - } - } - - - #create a database for each database specified - foreach my $dbtype (keys %{$db_conf->{'databases'}}) { - #don't create a database if there is a preloaded one specified - if (( $db_conf->{'preloaded'}->{$dbtype} ) && - ( _db_exists( $db,$db_conf->{'preloaded'}->{$dbtype} ))) { - #copy the general config into a dbtype specific config - $self->{'conf'}->{$dbtype} = {}; - %{$self->{'conf'}->{$dbtype}} = %$db_conf; - $self->{'conf'}->{$dbtype}->{'module'} = $db_conf->{'databases'}->{$dbtype}; - - # it's not necessary to store the databases and zip bits of info - delete $self->{'conf'}->{$dbtype}->{'databases'}; - delete $self->{'conf'}->{$dbtype}->{'zip'}; - - - #store the temporary database name in the dbtype specific config - $self->{'conf'}->{$dbtype}->{'dbname'} = $db_conf->{'preloaded'}->{$dbtype}; - $self->{'conf'}->{$dbtype}->{'preloaded'} = 1; - } else { - - $self->{'conf'}->{$dbtype} = {}; - %{$self->{'conf'}->{$dbtype}} = %$db_conf; - $self->{'conf'}->{$dbtype}->{'module'} = $db_conf->{'databases'}->{$dbtype}; - - # it's not necessary to store the databases and zip bits of info - delete $self->{'conf'}->{$dbtype}->{'databases'}; - delete $self->{'conf'}->{$dbtype}->{'zip'}; - - #create a unique random dbname - my $dbname = $db_conf->{'preloaded'}->{$dbtype}; - if ( ! defined $dbname ) { - $dbname = $self->_create_db_name($dbtype); - delete $self->{'conf'}->{$dbtype}->{'preloaded'}; - } else { - $self->{'conf'}->{$dbtype}->{'preloaded'} = 1; - } - - #store the temporary database name in the dbtype specific config - $self->{'conf'}->{$dbtype}->{'dbname'} = $dbname; - - print STDERR "\nCreating db $dbname"; - - unless($db->do("CREATE DATABASE $dbname")) { - warning("Could not create database [$dbname]"); - return; - } - - #copy the general config into a dbtype specific config - - $db->do("use $dbname"); - - #load the database with data - my $dir = $self->curr_dir . "$DUMP_DIR/".$self->species."/$dbtype"; - local *DIR; - - unless(opendir(DIR, $dir)) { - warning("could not open dump directory '$dir'"); - return; - } - - my @files = readdir DIR; - - local *FILE; - - #read in table creat statements from *.sql files and process them with DBI - - foreach my $sql_file (grep /\.sql$/, @files) { - - $sql_file = "$dir/$sql_file"; - - unless(-f $sql_file && -r $sql_file) { - warning("could not read SQL file '$sql_file'\n"); - next; - } - - open(FILE, $sql_file); - - my $sql_com =''; - - while (<FILE>) { - next if ( /^#/ ); # ignore comments - next unless ( /\S/ ); # ignore lines of white spaces - - $sql_com .= $_; - } - $sql_com =~ s/;$//; # chop off the last ; - - $db->do($sql_com); - - close FILE; - - #import data from the txt files of the same name - $sql_file =~ /.*\/(.*)\.sql/; - my $tablename = $1; - - (my $txt_file = $sql_file) =~ s/\.sql$/\.txt/; - - unless(-f $txt_file && -r $txt_file) { - warning("could not read data file '$txt_file'\n"); - next; - } - - $db->do( "load data local infile '$txt_file' into table $tablename" ); - - } - } - print STDERR "\n"; - closedir DIR; - - } - - $db->disconnect; - -} - - -sub unzip_test_dbs { - my ($self, $zipfile) = @_; - - if (-e $self->curr_dir . $DUMP_DIR) { - warning("Test genome dbs already unpacked\n"); - return; - } - - unless($zipfile) { - throw("zipfile argument is required\n"); - } - - unless(-f $zipfile) { - warning("zipfile could not be found\n"); - return; - } - - # unzip the zip file quietly - - system ( "unzip -q $zipfile -d ". $self->curr_dir ); -} - - - - -sub get_DBAdaptor { - my ($self, $type) = @_; - - unless($type) { - die('type arg must be specified\n'); - } - - unless($self->{'db_adaptors'}->{$type}) { - warning("dbadaptor of type $type is not available\n"); - return undef; - } - - return $self->{'db_adaptors'}->{$type}; -} - - - -=head2 hide - - Arg [1] : string $dbtype - The type of the database containing the hidden table - Arg [2] : string $table - The name of the table to hide - Example : $multi_test_db->hide('core', 'gene', 'transcript', 'exon'); - Description: Hides the contents of specific table(s) in the specified db. - The table(s) are first renamed and an empty table are created - in their place by reading the table schema file. - Returntype : none - Exceptions : thrown if the adaptor for dbtype is not available - thrown if both arguments are not defined - warning if a table is already hidden - warning if a table cannot be hidden because its schema file - cannot be read - Caller : general - -=cut - -sub hide { - my ($self, $dbtype, @tables) = @_; - - unless($dbtype && @tables) { - die("dbtype and table args must be defined\n"); - } - - my $adaptor = $self->get_DBAdaptor($dbtype); - - unless($adaptor) { - die "adaptor for $dbtype is not available\n"; - } - - foreach my $table (@tables) { - - if($self->{'conf'}->{$dbtype}->{'hidden'}->{$table}) { - warning("table '$table' is already hidden and cannot be hidden again\n"); - next; - } - - my $hidden_name = "_hidden_$table"; - - #copy contents of table into a temp table - - my $sth = - $adaptor->prepare("CREATE TABLE $hidden_name " . - "SELECT * FROM $table"); - - $sth->execute(); - $sth->finish(); - - #delete the contents of the original table - $sth = $adaptor->prepare("DELETE FROM $table"); - $sth->execute(); - $sth->finish(); - - #update the hidden table config - $self->{'conf'}->{$dbtype}->{'hidden'}->{$table} = $hidden_name; - } -} - - - -=head2 restore - - Arg [1] : (optional) $dbtype - The dbtype of the table(s) to be restored. If not specified all - hidden tables in all the databases are restored. - Arg [2] : (optional) @tables - The name(s) of the table to be restored. If not specified all - hidden tables in the database $dbtype are restored. - Example : $self->restore('core', 'gene', 'transcript', 'exon'); - Description: Restores a list of hidden tables. The current version of the - table is discarded and the hidden table is renamed. - Returntype : none - Exceptions : thrown if the adaptor for a dbtype cannot be obtained - Caller : general - -=cut - -sub restore { - my ($self, $dbtype, @tables) = @_; - - if(!$dbtype) { - #restore all of the tables in every dbtype - - foreach my $dbtype (keys %{$self->{'conf'}}) { - $self->restore($dbtype); - } - - #lose the hidden table details - delete $self->{'conf'}->{'hidden'}; - - return; - } - - my $adaptor = $self->get_DBAdaptor($dbtype); - unless($adaptor) { - die "Adaptor for $dbtype is not available"; - } - - if(!@tables) { - #restore all of the tables for this db - @tables = keys %{$self->{'conf'}->{$dbtype}->{'hidden'}}; - } - - foreach my $table (@tables) { - my $hidden_name = $self->{'conf'}->{$dbtype}->{'hidden'}->{$table}; - - #delete current contents of table - my $sth = $adaptor->prepare("delete from $table"); - $sth->execute(); - $sth->finish(); - - #copy contents of tmp table back into main table - $sth = $adaptor->prepare("insert into $table " . - "select * from $hidden_name"); - $sth->execute(); - $sth->finish(); - - #drop temp table - $sth = $adaptor->prepare("drop table $hidden_name"); - $sth->execute(); - $sth->finish(); - - #delete value from hidden table config - delete $self->{'conf'}->{$dbtype}->{'hidden'}->{$table}; - } -} - -=head2 save - - Arg [1] : string $dbtype - The type of the database containing the hidden/saved table - Arg [2] : string $table - The name of the table to save - Example : $multi_test_db->save('core', 'gene', 'transcript', 'exon'); - Description: Saves the contents of specific table(s) in the specified db. - The table(s) are first renamed and an empty table are created - in their place by reading the table schema file. The contents - of the renamed table(s) are then copied back into the newly - created tables. The method piggy-backs on the hide method - and simply adds in the copying/insertion call. - Returntype : none - Exceptions : thrown if the adaptor for dbtype is not available - warning if a table cannot be copied if the hidden table does not - exist - Caller : general - -=cut - -sub save { - my ($self, $dbtype, @tables) = @_; - - # use the hide method to build the basic tables - $self->hide($dbtype, @tables); - - my $adaptor = $self->get_DBAdaptor($dbtype); - - unless($adaptor) { - die "adaptor for $dbtype is not available\n"; - } - - my $hidden_name = ''; - foreach my $table (@tables) { - - # only do if the hidden table exists - if($self->{'conf'}->{$dbtype}->{'hidden'}->{$table}) { - - $hidden_name = "_hidden_$table"; - - #copy the data from the hidden table into the new table - my $sth = $adaptor->prepare("insert into $table " . - "select * from $hidden_name"); - $sth->execute; - } - else { - warning("hidden table '$hidden_name' does not exist so saving is not possible\n"); - } - } -} - - -sub _db_exists { - my ( $db, $db_name ) = @_; - - my $db_names = $db->selectall_arrayref( "show databases" ); - for my $db_name_ref ( @$db_names ) { - if( $db_name_ref->[0] eq $db_name ) { - return 1; - } - } - - return 0; -} - - - -sub compare { - my ($self, $dbtype, $table) = @_; - - warning("save method not yet implemented\n"); - -} - - -sub species { - my ($self, $species) = @_; - - if($species) { - $self->{'species'} = $species; - } - - return $self->{'species'}; -} - - - -sub curr_dir { - my ($self, $cdir) = @_; - - if($cdir) { - $self->{'_curr_dir'} = $cdir; - } - - return $self->{'_curr_dir'}; -} - - - -sub _create_db_name { - my( $self, $dbtype ) = @_; - - my @t_info = localtime; - - my $date = join ( "_", $t_info[3],$t_info[4]+1); - my $time = join ( "", $t_info[2],$t_info[1],$t_info[0]); - - my $species = $self->species; - - # create a unique name using host and date / time info - my $db_name = "_test_db_${species}_${dbtype}_".$ENV{'USER'}."_".$date."_".$time; - - return $db_name; -} - - - - - -sub cleanup { - my $self = shift; - - #delete the unpacked schema and data files - $self->_delete_files($self->curr_dir . $DUMP_DIR); - - #remove all of the handles on dbadaptors - foreach my $dbtype (keys %{$self->{'db_adaptors'}}) { - delete $self->{'db_adaptors'}->{$dbtype}; - } - - #delete each of the created temporary databases - foreach my $dbtype (keys %{$self->{'conf'}}) { - - my $db_conf = $self->{'conf'}->{$dbtype}; - my $host = $db_conf->{'host'}; - my $user = $db_conf->{'user'}; - my $pass = $db_conf->{'pass'}; - my $port = $db_conf->{'port'}; - my $driver = $db_conf->{'driver'}; - my $dbname = $db_conf->{'dbname'}; - - if( $db_conf->{'preloaded'} ) { - next; - } - #connect to the database - my $locator = "DBI:".$driver.":host=".$host.";port=".$port; - - my $db = DBI->connect($locator, $user, $pass, {RaiseError => 1}); - - unless($db) { - die "Can't connect to database $locator"; - } - - print STDERR "Dropping db $dbname \n"; - $db->do("DROP database $dbname"); - $db->disconnect; - } - - my $conf_file = $self->curr_dir . $self->species . $FROZEN_CONF_EXT; - - #delete the frozen config file - if(-e $conf_file && -f $conf_file) { - unlink $conf_file; - } -} - - -sub _delete_files { - my ($self, $dir) = @_; - - local *DIR; - opendir DIR, $dir; - - #ignore files starting with '.' - - my @files = grep !/^\./, readdir DIR; - - foreach my $file (@files) { - - $file = $dir ."/". $file; - if(-d $file) { - - #call recursively on subdirectories - $self->_delete_files($file); - - } else { - unlink $file; - } - } - closedir DIR; - - rmdir $dir; -} - - -sub DESTROY { - my( $self ) = shift; - - if($ENV{'RUNTESTS_HARNESS'}) { - #restore tables, do nothing else we want to use the database for - #the other tests as well - $self->restore; - } else { - #we are runnning a stand-alone test, cleanup created databases - print STDERR "\nCleaning up....\n"; - #restore database state since we may not actually delete it in the - #cleanup - it may be defined as a preloaded db - $self->restore; - $self->cleanup; - } -} - - - - -1; - diff --git a/modules/t/MultiTestDB.t b/modules/t/MultiTestDB.t index 70cfe9d5bd..ed88d3b231 100755 --- a/modules/t/MultiTestDB.t +++ b/modules/t/MultiTestDB.t @@ -1,16 +1,15 @@ -use lib 't'; use Test; use strict; BEGIN { $| = 1; plan tests => 9 } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; ok(1); # Database will be dropped when this # object goes out of scope -my $ens_test = MultiTestDB->new; +my $ens_test = Bio::EnsEMBL::Test::MultiTestDB->new; ok($ens_test); diff --git a/modules/t/README b/modules/t/README index 3f50eb9e6a..eff5cdb81e 100755 --- a/modules/t/README +++ b/modules/t/README @@ -1,24 +1,35 @@ -This directory contains a set of tests for the EnsEMBL API +This directory contains a set of tests for the Ensembl API modules. The test_genome.zip file contains the set of data that is used by the tests. -In order to run the tests you must update the MultiTestDB.conf -file with the information (username, host, etc.) for a mysql -instance where you have write permission. Running test case(s) -which require a database will automatically create and remove -a temporary database during the test(s) execution. +The test system requires some modules which are in a seperate +CVS module ensembl-test. To use the tests you must add the +ensembl-test modules to your PERL5LIB environment variable. -To run multiple tests at once use the runtests.pl script in -the modules directory. To run a single test simply execute -the .t file: +Example: + +setenv PERL5LIB ${PERL5LIB}:${ENSHOME}/ensembl-test/modules + +In order to run the tests you must create a t/MultiTestDB.conf +file with connection details (username, host, etc.) for a mysql +instance where you have write permission. An example file named +MultiTestDB.conf.example is included in the /t directory. +Running test case(s) which require a database will +automatically create and remove a temporary database during the +test(s) execution. + +To run multiple tests at once use the runtests.pl script +which is found in the ensembl-test/scripts directory. It +may be useful to add this directory to your path. +To run a single test simply execute the .t file: Examples: -#run all tests in the t directory -perl runtests.pl t +# run all tests in the t directory +runtests.pl t -#run 3 tests -perl runtests.pl t/gene.t t/exon.t t/densityFeature.t +# run 3 tests +runtests.pl t/gene.t t/exon.t t/densityFeature.t -#run a single test +# run a single test perl t/gene.t diff --git a/modules/t/analysis.t b/modules/t/analysis.t index e42fac8082..51e7465a74 100644 --- a/modules/t/analysis.t +++ b/modules/t/analysis.t @@ -1,4 +1,3 @@ -use lib 't'; BEGIN { $| = 1; use Test; @@ -8,7 +7,7 @@ BEGIN { $| = 1; my $loaded = 0; END {print "not ok 1\n" unless $loaded;} -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; our $verbose = 0; @@ -16,7 +15,7 @@ $loaded = 1; ok(1); -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); ok( $multi ); $multi->hide( "core", "analysis" ); diff --git a/modules/t/archiveStableId.t b/modules/t/archiveStableId.t index 3731d33a4d..3790d2e869 100644 --- a/modules/t/archiveStableId.t +++ b/modules/t/archiveStableId.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; use warnings; @@ -8,9 +7,9 @@ BEGIN { $| = 1; plan tests => 9; } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::DBSQL::ArchiveStableIdAdaptor; -use TestUtils qw(test_getter_setter debug); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; @@ -20,7 +19,7 @@ our $verbose = 0; # ok(1); -my $multi = MultiTestDB->new; +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi->get_DBAdaptor('core'); my $asia = $db->get_ArchiveStableIdAdaptor(); diff --git a/modules/t/argument.t b/modules/t/argument.t index e8fb3eee6a..f0464111d9 100644 --- a/modules/t/argument.t +++ b/modules/t/argument.t @@ -1,14 +1,13 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; plan tests => 4; } -use TestUtils qw( debug ); +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Utils::Argument qw(rearrange); diff --git a/modules/t/assemblyException.t b/modules/t/assemblyException.t index 8a0ae822fc..701f3beb49 100644 --- a/modules/t/assemblyException.t +++ b/modules/t/assemblyException.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -7,14 +6,14 @@ BEGIN { $| = 1; } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::DnaDnaAlignFeature; -use TestUtils qw(test_getter_setter debug); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); ok(1); my $db = $multi->get_DBAdaptor('core'); diff --git a/modules/t/assemblyExceptionFeature.t b/modules/t/assemblyExceptionFeature.t index 6d92666930..78fd352aea 100644 --- a/modules/t/assemblyExceptionFeature.t +++ b/modules/t/assemblyExceptionFeature.t @@ -1,20 +1,19 @@ use strict; -use lib 't'; -use TestUtils qw(test_getter_setter debug); +use Bio::EnsEMBL::Test::TestUtils; BEGIN { $| = 1; use Test; plan tests => 9; } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::AssemblyExceptionFeature; our $verbose = 0; -my $multi = MultiTestDB->new; +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new; # get a core DBAdaptor # diff --git a/modules/t/assemblyMapper.t b/modules/t/assemblyMapper.t index 244f4d47ec..2e3354a42b 100644 --- a/modules/t/assemblyMapper.t +++ b/modules/t/assemblyMapper.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -6,12 +5,12 @@ BEGIN { $| = 1; plan tests => 9; } -use MultiTestDB; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor( 'core' ); # diff --git a/modules/t/attribute.t b/modules/t/attribute.t index 29ef018ab0..2712632d13 100644 --- a/modules/t/attribute.t +++ b/modules/t/attribute.t @@ -1,11 +1,10 @@ -use lib 't'; use strict; use warnings; use Bio::EnsEMBL::Attribute; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts @@ -14,7 +13,7 @@ BEGIN { $| = 1; plan tests => 8; } -use TestUtils qw( debug test_getter_setter ); +use Bio::EnsEMBL::Test::TestUtils; # # test constructor diff --git a/modules/t/attributeAdaptor.t b/modules/t/attributeAdaptor.t index 545e8cb9d8..2f5b4f2310 100644 --- a/modules/t/attributeAdaptor.t +++ b/modules/t/attributeAdaptor.t @@ -1,19 +1,18 @@ use strict; -use lib 't'; -use TestUtils qw(test_getter_setter debug); +use Bio::EnsEMBL::Test::TestUtils; BEGIN { $| = 1; use Test; plan tests => 22; } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Attribute; our $verbose = 0; -my $multi = MultiTestDB->new; +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new; # get a core DBAdaptor my $db = $multi->get_DBAdaptor("core"); diff --git a/modules/t/canonicalDBAdaptor.t b/modules/t/canonicalDBAdaptor.t index 0871ce7b4f..4721514081 100644 --- a/modules/t/canonicalDBAdaptor.t +++ b/modules/t/canonicalDBAdaptor.t @@ -1,7 +1,6 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; @@ -9,15 +8,15 @@ BEGIN { $| = 1; } -use TestUtils qw(debug test_getter_setter); -use MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::DBSQL::DBAdaptor; use Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor; use Bio::EnsEMBL::DBSQL::ProteinFeatureAdaptor; use Bio::EnsEMBL::DBSQL::DnaAlignFeatureAdaptor; # Get a DBAdaptor to from the test system -my $multi = MultiTestDB->new; +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new; ok($multi); my $db = $multi->get_DBAdaptor("core"); ok($db); @@ -85,7 +84,7 @@ $test_adaptor = $db->get_MarkerAdaptor(); ok($test_adaptor->isa("Bio::EnsEMBL::Map::DBSQL::MarkerAdaptor")); # Note get_BlastAdaptor() and get_SNPAdaptor() require DBs of type -# 'blast' and 'lite' respectively - these are not available via MultiTestDB +# 'blast' and 'lite' respectively - these are not available via Bio::EnsEMBL::Test::MultiTestDB #my $blast_db = $multi->get_DBAdaptor("lite"); #ok($blast_db); #$test_adaptor = $blast_db->get_BlastAdaptor(); diff --git a/modules/t/chainedAssemblyMapper.t b/modules/t/chainedAssemblyMapper.t index 46c421fe13..44612091a1 100644 --- a/modules/t/chainedAssemblyMapper.t +++ b/modules/t/chainedAssemblyMapper.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -6,12 +5,12 @@ BEGIN { $| = 1; plan tests => 14; } -use MultiTestDB; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor( 'core' ); # diff --git a/modules/t/chromosome.t b/modules/t/chromosome.t index f8f2687914..9f2caa8fb6 100644 --- a/modules/t/chromosome.t +++ b/modules/t/chromosome.t @@ -1,7 +1,6 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; @@ -9,8 +8,8 @@ BEGIN { $| = 1; } -use MultiTestDB; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Utils::Exception qw(verbose); use Bio::EnsEMBL::Chromosome; @@ -36,7 +35,7 @@ my $CHR = '20'; my $DBID = 123; my $LENGTH = 250_000_000; -my $multi_db = MultiTestDB->new; +my $multi_db = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi_db->get_DBAdaptor('core'); my $ca = $db->get_ChromosomeAdaptor; diff --git a/modules/t/clone.t b/modules/t/clone.t index a3b175ddfc..f43fa56546 100644 --- a/modules/t/clone.t +++ b/modules/t/clone.t @@ -1,10 +1,9 @@ -use lib 't'; use Test; use strict; BEGIN { $| = 1; plan tests => 6;} -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::Seq; use Bio::EnsEMBL::RawContig; use Bio::EnsEMBL::Clone; @@ -25,7 +24,7 @@ ok(1); # Database will be dropped when this # object goes out of scope -my $multi = MultiTestDB->new; +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new; ok($multi); diff --git a/modules/t/compressedSequenceAdaptor.t b/modules/t/compressedSequenceAdaptor.t index 0cc46276d7..bd65e370d2 100644 --- a/modules/t/compressedSequenceAdaptor.t +++ b/modules/t/compressedSequenceAdaptor.t @@ -1,21 +1,20 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; plan tests => 3; } -use TestUtils qw( debug ); +use Bio::EnsEMBL::Test::TestUtils; -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Slice; our $verbose= 0; -my $multi_db = MultiTestDB->new; +my $multi_db = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi_db->get_DBAdaptor('core'); # diff --git a/modules/t/container.t b/modules/t/container.t index 3643a452da..6f2e74b7e7 100644 --- a/modules/t/container.t +++ b/modules/t/container.t @@ -1,7 +1,6 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; diff --git a/modules/t/coordSystem.t b/modules/t/coordSystem.t index 9176b17d07..fcf1dcb238 100644 --- a/modules/t/coordSystem.t +++ b/modules/t/coordSystem.t @@ -1,10 +1,9 @@ use strict; use warnings; -use lib 't'; use Bio::EnsEMBL::CoordSystem; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; diff --git a/modules/t/coordSystemAdaptor.t b/modules/t/coordSystemAdaptor.t index 840ad0d624..bf32f4b297 100644 --- a/modules/t/coordSystemAdaptor.t +++ b/modules/t/coordSystemAdaptor.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -6,12 +5,12 @@ BEGIN { $| = 1; plan tests => 32; } -use MultiTestDB; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor( 'core' ); diff --git a/modules/t/dbConnection.t b/modules/t/dbConnection.t index 3ccceb4763..3f7357b03c 100644 --- a/modules/t/dbConnection.t +++ b/modules/t/dbConnection.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; use warnings; @@ -8,9 +7,9 @@ BEGIN { $| = 1; plan tests => 30; } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::DBSQL::SliceAdaptor; -use TestUtils qw(test_getter_setter debug); +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::DBSQL::DBConnection; @@ -21,7 +20,7 @@ our $verbose = 0; # ok(1); -my $multi = MultiTestDB->new; +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi->get_DBAdaptor('core'); diff --git a/modules/t/dbEntries.t b/modules/t/dbEntries.t index 65bf9bc617..22f95b066b 100644 --- a/modules/t/dbEntries.t +++ b/modules/t/dbEntries.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; use warnings; @@ -7,8 +6,8 @@ BEGIN { $| = 1; plan tests => 42; } -use MultiTestDB; -use TestUtils qw ( debug test_getter_setter count_rows ); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::DBEntry; @@ -22,7 +21,7 @@ debug( "Startup test" ); # ok(1); -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor( "core" ); diff --git a/modules/t/densityFeature.t b/modules/t/densityFeature.t index 35e7e44d56..38788c93e9 100644 --- a/modules/t/densityFeature.t +++ b/modules/t/densityFeature.t @@ -1,14 +1,13 @@ -use lib 't'; use strict; use warnings; use Bio::EnsEMBL::DensityFeature; -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Analysis; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts @@ -20,9 +19,9 @@ BEGIN { $| = 1; plan tests => 4; } -use TestUtils qw( debug ); +use Bio::EnsEMBL::Test::TestUtils; -my $multi = MultiTestDB->new; +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi->get_DBAdaptor('core'); diff --git a/modules/t/densityFeatureAdaptor.t b/modules/t/densityFeatureAdaptor.t index f589e75ad1..2531c6938b 100644 --- a/modules/t/densityFeatureAdaptor.t +++ b/modules/t/densityFeatureAdaptor.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; use warnings; @@ -11,8 +10,8 @@ use Bio::EnsEMBL::Slice; use Bio::EnsEMBL::Analysis; use Bio::EnsEMBL::DensityType; use Bio::EnsEMBL::DensityFeature; -use TestUtils qw( debug ); -use MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; +use Bio::EnsEMBL::Test::MultiTestDB; BEGIN { $| = 1; use Test; @@ -24,7 +23,7 @@ BEGIN { $| = 1; our $verbose = 0; verbose('WARNING'); -my $multi = MultiTestDB->new; +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi->get_DBAdaptor('core'); diff --git a/modules/t/densityType.t b/modules/t/densityType.t index 78732025b7..7c660e894d 100644 --- a/modules/t/densityType.t +++ b/modules/t/densityType.t @@ -1,13 +1,12 @@ -use lib 't'; use strict; use warnings; use Bio::EnsEMBL::DensityType; use Bio::EnsEMBL::Analysis; -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts @@ -18,7 +17,7 @@ BEGIN { $| = 1; plan tests => 9; } -use TestUtils qw( debug ); +use Bio::EnsEMBL::Test::TestUtils; diff --git a/modules/t/densityTypeAdaptor.t b/modules/t/densityTypeAdaptor.t index 820209eb69..b33c81a7d8 100644 --- a/modules/t/densityTypeAdaptor.t +++ b/modules/t/densityTypeAdaptor.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; @@ -7,15 +6,15 @@ BEGIN { $| = 1; plan tests => 20; } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Analysis; use Bio::EnsEMBL::DensityType; -use TestUtils qw(count_rows); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); ok( $multi ); my $db = $multi->get_DBAdaptor( "core" ); diff --git a/modules/t/dnaAlignFeatureAdaptor.t b/modules/t/dnaAlignFeatureAdaptor.t index 293e054c24..bf085052f6 100644 --- a/modules/t/dnaAlignFeatureAdaptor.t +++ b/modules/t/dnaAlignFeatureAdaptor.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -7,14 +6,14 @@ BEGIN { $| = 1; } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::DnaDnaAlignFeature; -use TestUtils qw(test_getter_setter debug); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); ok(1); my $db = $multi->get_DBAdaptor('core'); diff --git a/modules/t/dnaDnaAlignFeature.t b/modules/t/dnaDnaAlignFeature.t index 64ea7709d8..b326ee3a6b 100644 --- a/modules/t/dnaDnaAlignFeature.t +++ b/modules/t/dnaDnaAlignFeature.t @@ -1,5 +1,4 @@ -use lib 't'; BEGIN { $| = 1; use Test; @@ -8,7 +7,7 @@ BEGIN { $| = 1; use strict; -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::DnaDnaAlignFeature; use Bio::EnsEMBL::FeaturePair; @@ -21,7 +20,7 @@ my $CTG_BOUNDARY = 62877; # ok(1); -my $multi_db = MultiTestDB->new; +my $multi_db = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi_db->get_DBAdaptor('core'); diff --git a/modules/t/dnaPepAlignFeature.t b/modules/t/dnaPepAlignFeature.t index 7ff1a35370..9b760d75ac 100644 --- a/modules/t/dnaPepAlignFeature.t +++ b/modules/t/dnaPepAlignFeature.t @@ -1,5 +1,4 @@ -use lib 't'; BEGIN { $| = 1; use Test; @@ -8,10 +7,10 @@ BEGIN { $| = 1; use strict; -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::DnaPepAlignFeature; -use TestUtils qw ( debug test_getter_setter ); +use Bio::EnsEMBL::Test::TestUtils; # switch on the debug prints @@ -25,7 +24,7 @@ my $CTG_BOUNDARY = 62877; # ok(1); -my $multi_db = MultiTestDB->new; +my $multi_db = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi_db->get_DBAdaptor('core'); diff --git a/modules/t/easyargv.t b/modules/t/easyargv.t index e9407ac2ac..c60171fc20 100644 --- a/modules/t/easyargv.t +++ b/modules/t/easyargv.t @@ -1,5 +1,4 @@ use strict; -use lib 't'; use Test; BEGIN { $| = 1; plan tests => 1;} diff --git a/modules/t/exception.t b/modules/t/exception.t index 373b558fd2..de01c097d8 100644 --- a/modules/t/exception.t +++ b/modules/t/exception.t @@ -1,14 +1,13 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; plan tests => 9; } -use TestUtils qw( debug ); +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Utils::Exception qw(warning verbose throw info deprecate stack_trace_dump stack_trace); diff --git a/modules/t/exon.t b/modules/t/exon.t index 5ceed8f966..4e0f3e875b 100644 --- a/modules/t/exon.t +++ b/modules/t/exon.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -9,13 +8,13 @@ BEGIN { $| = 1; my $loaded = 0; END {print "not ok 1\n" unless $loaded;} -use MultiTestDB; -use TestUtils qw(debug test_getter_setter count_rows); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts $loaded = 1; -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); ok(1); diff --git a/modules/t/externalFeatureAdaptor.t b/modules/t/externalFeatureAdaptor.t index 8df98199c5..bed97c68c2 100644 --- a/modules/t/externalFeatureAdaptor.t +++ b/modules/t/externalFeatureAdaptor.t @@ -2,11 +2,11 @@ use strict; our $verbose = 0; -my $multi = MultiTestDB->new; +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new; package ExternalFF1; use Bio::EnsEMBL::External::ExternalFeatureAdaptor; - use MultiTestDB; + use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Feature; use vars qw(@ISA); @@ -41,7 +41,7 @@ package ExternalFF1; package ExternalFF2; use Bio::EnsEMBL::External::ExternalFeatureAdaptor; - use MultiTestDB; + use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Feature; use vars qw(@ISA); @@ -77,8 +77,7 @@ package ExternalFF2; package Test; -use lib 't'; -use TestUtils qw(test_getter_setter debug); +use Bio::EnsEMBL::Test::TestUtils; BEGIN { $| = 1; use Test; diff --git a/modules/t/feature.t b/modules/t/feature.t index 59858e1b6f..8a9d9304fe 100644 --- a/modules/t/feature.t +++ b/modules/t/feature.t @@ -1,25 +1,24 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; plan tests => 102; } -use TestUtils qw( debug test_getter_setter ); +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Feature; use Bio::EnsEMBL::Slice; use Bio::EnsEMBL::Analysis; use Bio::EnsEMBL::CoordSystem; -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; our $verbose= 0; #turn on or off debug statements -my $multi_db = MultiTestDB->new; +my $multi_db = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi_db->get_DBAdaptor('core'); my $coord_system = Bio::EnsEMBL::CoordSystem->new diff --git a/modules/t/featurePair.t b/modules/t/featurePair.t index d367105e2c..e017d049e0 100644 --- a/modules/t/featurePair.t +++ b/modules/t/featurePair.t @@ -1,20 +1,19 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; plan tests => 34; } -use TestUtils qw( debug test_getter_setter ); +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::FeaturePair; use Bio::EnsEMBL::Slice; use Bio::EnsEMBL::Analysis; use Bio::EnsEMBL::CoordSystem; -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; our $verbose= 0; #turn on or off debug statements diff --git a/modules/t/gene.t b/modules/t/gene.t index 15bea38266..b45a1d3d03 100644 --- a/modules/t/gene.t +++ b/modules/t/gene.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; use warnings; @@ -7,8 +6,8 @@ BEGIN { $| = 1; plan tests => 59; } -use MultiTestDB; -use TestUtils qw ( debug test_getter_setter count_rows); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Exon; use Bio::EnsEMBL::FeaturePair; use Bio::EnsEMBL::Transcript; @@ -22,7 +21,7 @@ our $verbose = 0; debug( "Startup test" ); ok(1); -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor( "core" ); diff --git a/modules/t/geneview.t b/modules/t/geneview.t index 7bf01319ff..f662430526 100644 --- a/modules/t/geneview.t +++ b/modules/t/geneview.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; use warnings; use vars qw( $verbose ); @@ -9,14 +8,14 @@ BEGIN { $| = 1; } -use MultiTestDB; -use TestUtils qw( debug ); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; $verbose = 0; ok(1); -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); ok($multi); diff --git a/modules/t/intron.t b/modules/t/intron.t index 666a574289..da4bcd7571 100644 --- a/modules/t/intron.t +++ b/modules/t/intron.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -9,13 +8,13 @@ BEGIN { $| = 1; my $loaded = 0; END {print "not ok 1\n" unless $loaded;} -use MultiTestDB; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts $loaded = 1; -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); ok(1); diff --git a/modules/t/karyotypeBand.t b/modules/t/karyotypeBand.t index 8bf8e3228c..1639ba1922 100644 --- a/modules/t/karyotypeBand.t +++ b/modules/t/karyotypeBand.t @@ -1,7 +1,6 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; @@ -9,7 +8,7 @@ BEGIN { $| = 1; } -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::KaryotypeBand; use Bio::EnsEMBL::Slice; use Bio::EnsEMBL::CoordSystem; diff --git a/modules/t/karyotypeBandAdaptor.t b/modules/t/karyotypeBandAdaptor.t index 8f6abda114..551d67c8a9 100644 --- a/modules/t/karyotypeBandAdaptor.t +++ b/modules/t/karyotypeBandAdaptor.t @@ -1,7 +1,6 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; @@ -9,13 +8,13 @@ BEGIN { $| = 1; } -use MultiTestDB; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::KaryotypeBand; our $verbose= 0; -my $multi_db = MultiTestDB->new; +my $multi_db = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi_db->get_DBAdaptor('core'); diff --git a/modules/t/mapLocation.t b/modules/t/mapLocation.t index 275c780416..8f5129d082 100644 --- a/modules/t/mapLocation.t +++ b/modules/t/mapLocation.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -7,13 +6,13 @@ BEGIN { $| = 1; } use Bio::EnsEMBL::Map::MapLocation; -use MultiTestDB; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor( 'core' ); diff --git a/modules/t/mapper.t b/modules/t/mapper.t index 73cf98c5f2..433d6f2772 100644 --- a/modules/t/mapper.t +++ b/modules/t/mapper.t @@ -29,7 +29,6 @@ BEGIN { $| = 1; use vars qw($loaded); } END { print "not ok 1\n" unless $loaded; } -use lib 't'; $loaded = 1; # $n_test = 0; diff --git a/modules/t/marker.t b/modules/t/marker.t index 56a7df40f2..af03817b78 100644 --- a/modules/t/marker.t +++ b/modules/t/marker.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -6,14 +5,14 @@ BEGIN { $| = 1; plan tests => 23; } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Map::Marker; use Bio::EnsEMBL::Map::MarkerSynonym; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor( 'core' ); my $dbID = 1; diff --git a/modules/t/markerAdaptor.t b/modules/t/markerAdaptor.t index 50d6748b5e..645cce0346 100644 --- a/modules/t/markerAdaptor.t +++ b/modules/t/markerAdaptor.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -6,13 +5,13 @@ BEGIN { $| = 1; plan tests => 7; } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor( 'core' ); diff --git a/modules/t/markerFeature.t b/modules/t/markerFeature.t index 57c99909a7..cd5ab3bad3 100644 --- a/modules/t/markerFeature.t +++ b/modules/t/markerFeature.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -6,15 +5,15 @@ BEGIN { $| = 1; plan tests => 12 } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Map::MarkerFeature; use Bio::EnsEMBL::Map::MarkerSynonym; use Bio::EnsEMBL::Analysis; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor( 'core' ); ###### diff --git a/modules/t/markerFeatureAdaptor.t b/modules/t/markerFeatureAdaptor.t index 73a7334f20..23396dc8bc 100644 --- a/modules/t/markerFeatureAdaptor.t +++ b/modules/t/markerFeatureAdaptor.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -6,12 +5,12 @@ BEGIN { $| = 1; plan tests => 7 } -use MultiTestDB; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor( 'core' ); ###### diff --git a/modules/t/markerSynonym.t b/modules/t/markerSynonym.t index 2ee5d90b89..cce33ca184 100644 --- a/modules/t/markerSynonym.t +++ b/modules/t/markerSynonym.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -8,7 +7,7 @@ BEGIN { $| = 1; use Bio::EnsEMBL::Map::MarkerSynonym; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts diff --git a/modules/t/metaContainer.t b/modules/t/metaContainer.t index 62a744513b..b7ccb84f1d 100644 --- a/modules/t/metaContainer.t +++ b/modules/t/metaContainer.t @@ -1,19 +1,18 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; plan tests => 8; } -use TestUtils qw( debug ); +use Bio::EnsEMBL::Test::TestUtils; -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; -my $mdb = MultiTestDB->new(); +my $mdb = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $mdb->get_DBAdaptor('core'); $mdb->save('core', 'meta'); diff --git a/modules/t/metaCoordContainer.t b/modules/t/metaCoordContainer.t index a428ee60a3..147718d380 100644 --- a/modules/t/metaCoordContainer.t +++ b/modules/t/metaCoordContainer.t @@ -1,19 +1,18 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; plan tests => 7; } -use TestUtils qw( debug count_rows); +use Bio::EnsEMBL::Test::TestUtils; -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor('core'); $multi->save('core', 'meta_coord'); diff --git a/modules/t/miscFeature.t b/modules/t/miscFeature.t index 52484439ab..6df93a5cc1 100644 --- a/modules/t/miscFeature.t +++ b/modules/t/miscFeature.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -6,11 +5,11 @@ BEGIN { $| = 1; plan tests => 8 } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Attribute; use Bio::EnsEMBL::MiscFeature; use Bio::EnsEMBL::MiscSet; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts diff --git a/modules/t/miscFeatureAdaptor.t b/modules/t/miscFeatureAdaptor.t index a223d93980..bdefb8232f 100644 --- a/modules/t/miscFeatureAdaptor.t +++ b/modules/t/miscFeatureAdaptor.t @@ -1,14 +1,13 @@ use strict; -use lib 't'; -use TestUtils qw(test_getter_setter debug); +use Bio::EnsEMBL::Test::TestUtils; BEGIN { $| = 1; use Test; plan tests => 18; } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Attribute; use Bio::EnsEMBL::MiscSet; @@ -16,7 +15,7 @@ use Bio::EnsEMBL::MiscSet; our $verbose = 0; -my $multi = MultiTestDB->new; +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new; # get a core DBAdaptor my $dba = $multi->get_DBAdaptor("core"); diff --git a/modules/t/miscSet.t b/modules/t/miscSet.t index 200dcdd977..b76e144a6b 100644 --- a/modules/t/miscSet.t +++ b/modules/t/miscSet.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -7,7 +6,7 @@ BEGIN { $| = 1; } use Bio::EnsEMBL::MiscSet; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts diff --git a/modules/t/miscSetAdaptor.t b/modules/t/miscSetAdaptor.t index 2f60829abe..a6c6e84492 100644 --- a/modules/t/miscSetAdaptor.t +++ b/modules/t/miscSetAdaptor.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -6,14 +5,14 @@ BEGIN { $| = 1; plan tests => 21 } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::MiscSet; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts -my $multi_db = MultiTestDB->new; +my $multi_db = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi_db->get_DBAdaptor('core'); diff --git a/modules/t/predictionTranscript.t b/modules/t/predictionTranscript.t index a779edc352..4b0044a722 100644 --- a/modules/t/predictionTranscript.t +++ b/modules/t/predictionTranscript.t @@ -1,15 +1,14 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; plan tests => 39; } -use MultiTestDB; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::PredictionTranscript; our $verbose = 0; @@ -19,7 +18,7 @@ our $verbose = 0; # ok(1); -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor( "core" ); @@ -66,30 +65,30 @@ ok($pt->stable_id =~ /.*/ ); # # 6 test start # -ok(&TestUtils::test_getter_setter($pt, 'start', 8)); +ok(&Bio::EnsEMBL::Test::TestUtils::test_getter_setter($pt, 'start', 8)); # # 7 test end # -ok(&TestUtils::test_getter_setter($pt, 'end', 9)); +ok(&Bio::EnsEMBL::Test::TestUtils::test_getter_setter($pt, 'end', 9)); # # 8 test analysis # my $analysis = $db->get_AnalysisAdaptor->fetch_by_logic_name('Vertrna'); -ok(&TestUtils::test_getter_setter($pt, 'analysis', $analysis)); +ok(&Bio::EnsEMBL::Test::TestUtils::test_getter_setter($pt, 'analysis', $analysis)); # # 9 test dbID # -ok(&TestUtils::test_getter_setter($pt, 'dbID', 11)); +ok(&Bio::EnsEMBL::Test::TestUtils::test_getter_setter($pt, 'dbID', 11)); # # 10 test adaptor # my $pta = $db->get_PredictionTranscriptAdaptor; -ok(&TestUtils::test_getter_setter($pt, 'adaptor', $pta)); +ok(&Bio::EnsEMBL::Test::TestUtils::test_getter_setter($pt, 'adaptor', $pta)); # # 11-14 test add Exon @@ -236,7 +235,7 @@ ok($defined_exons_count == $pt->cdna2genomic( 1, $pt->length())); # # 30 test type # -ok(&TestUtils::test_getter_setter($pt, 'type', 'test')); +ok(&Bio::EnsEMBL::Test::TestUtils::test_getter_setter($pt, 'type', 'test')); # # 31 test fetch_by_stable_id diff --git a/modules/t/proteinAlignFeatureAdaptor.t b/modules/t/proteinAlignFeatureAdaptor.t index 558c256e92..40a7ef23c2 100644 --- a/modules/t/proteinAlignFeatureAdaptor.t +++ b/modules/t/proteinAlignFeatureAdaptor.t @@ -1,4 +1,3 @@ -use lib 't'; BEGIN { $| = 1; use Test; @@ -6,14 +5,14 @@ BEGIN { $| = 1; } -use MultiTestDB; -use TestUtils qw(test_getter_setter debug); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::DnaPepAlignFeature; our $verbose = 0; -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); ok(1); my $db = $multi->get_DBAdaptor('core'); diff --git a/modules/t/proteinFeature.t b/modules/t/proteinFeature.t index dd333ddcb9..002001cde9 100644 --- a/modules/t/proteinFeature.t +++ b/modules/t/proteinFeature.t @@ -1,14 +1,13 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; plan tests => 17; } -use TestUtils qw( debug test_getter_setter ); +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::ProteinFeature; use Bio::EnsEMBL::Analysis; diff --git a/modules/t/proteinFeatureAdaptor.t b/modules/t/proteinFeatureAdaptor.t index 795170d48c..da374564e4 100644 --- a/modules/t/proteinFeatureAdaptor.t +++ b/modules/t/proteinFeatureAdaptor.t @@ -1,18 +1,17 @@ use strict; -use lib 't'; -use TestUtils qw(test_getter_setter debug); +use Bio::EnsEMBL::Test::TestUtils; BEGIN { $| = 1; use Test; plan tests => 2; } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; our $verbose = 0; -my $multi = MultiTestDB->new; +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new; # get a core DBAdaptor my $dba = $multi->get_DBAdaptor("core"); diff --git a/modules/t/qtl.t b/modules/t/qtl.t index ac9b1b555a..f0930387ae 100644 --- a/modules/t/qtl.t +++ b/modules/t/qtl.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; use warnings; @@ -7,7 +6,7 @@ BEGIN { $| = 1; plan tests => 6; } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Map::Marker; use Bio::EnsEMBL::Map::MarkerSynonym; @@ -15,11 +14,11 @@ use Bio::EnsEMBL::Map::DBSQL::QtlAdaptor; use Bio::EnsEMBL::Map::DBSQL::QtlFeatureAdaptor; use Bio::EnsEMBL::Slice; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor( 'core' ); my $sa = $db->get_SliceAdaptor(); diff --git a/modules/t/rangeRegistry.t b/modules/t/rangeRegistry.t index 657560cbb7..6ee3697b91 100644 --- a/modules/t/rangeRegistry.t +++ b/modules/t/rangeRegistry.t @@ -1,14 +1,13 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; plan tests => 21; } -use TestUtils qw( debug ); +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Mapper::RangeRegistry; diff --git a/modules/t/rawContig.t b/modules/t/rawContig.t index 65f37c9d28..ad48a8e7f2 100755 --- a/modules/t/rawContig.t +++ b/modules/t/rawContig.t @@ -1,12 +1,11 @@ -use lib 't'; BEGIN { $| = 1; use Test; plan tests => 19; } -use MultiTestDB; -use TestUtils qw(debug); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Utils::Exception qw(verbose); @@ -24,7 +23,7 @@ our $verbose = 0; #set to 1 for debug printing ok(1); -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); ok($multi); diff --git a/modules/t/rawContigAdaptor.t b/modules/t/rawContigAdaptor.t index ab84ac0369..3a8422a297 100644 --- a/modules/t/rawContigAdaptor.t +++ b/modules/t/rawContigAdaptor.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; use warnings; @@ -8,10 +7,10 @@ BEGIN { $| = 1; plan tests => 26; } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::DBSQL::RawContigAdaptor; use Bio::EnsEMBL::RawContig; -use TestUtils qw(test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; use Bio::Seq; use Bio::EnsEMBL::Utils::Exception qw(verbose); @@ -32,7 +31,7 @@ verbose(-1); # ok(1); -my $multi = MultiTestDB->new; +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi->get_DBAdaptor('core'); diff --git a/modules/t/repeatConsensus.t b/modules/t/repeatConsensus.t index 9b843aca7f..b18db2bbe7 100644 --- a/modules/t/repeatConsensus.t +++ b/modules/t/repeatConsensus.t @@ -1,6 +1,5 @@ use strict; -use lib 't'; -use TestUtils qw(test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::RepeatConsensus; diff --git a/modules/t/repeatConsensusAdaptor.t b/modules/t/repeatConsensusAdaptor.t index 52ed37c21b..dd59d46e6d 100644 --- a/modules/t/repeatConsensusAdaptor.t +++ b/modules/t/repeatConsensusAdaptor.t @@ -1,8 +1,7 @@ use strict; -use lib 't'; -use TestUtils qw(test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; BEGIN { $| = 1; @@ -10,7 +9,7 @@ BEGIN { $| = 1; plan tests => 24; } -my $multi_db = MultiTestDB->new; +my $multi_db = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi_db->get_DBAdaptor('core'); my $verbose = 0; diff --git a/modules/t/repeatFeature.t b/modules/t/repeatFeature.t index 6ee22d31c0..a8b5f2e8a5 100644 --- a/modules/t/repeatFeature.t +++ b/modules/t/repeatFeature.t @@ -7,7 +7,6 @@ use Bio::EnsEMBL::RepeatConsensus; use Bio::EnsEMBL::CoordSystem; use Bio::EnsEMBL::RepeatFeature; -use lib 't'; BEGIN { $| = 1; use Test; @@ -15,7 +14,7 @@ BEGIN { $| = 1; } -use TestUtils qw(test_getter_setter debug); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; diff --git a/modules/t/repeatFeatureAdaptor.t b/modules/t/repeatFeatureAdaptor.t index f1ecd5057b..48ef0b7e73 100644 --- a/modules/t/repeatFeatureAdaptor.t +++ b/modules/t/repeatFeatureAdaptor.t @@ -1,6 +1,5 @@ use strict; -use lib 't'; BEGIN { $| = 1; use Test; @@ -8,13 +7,13 @@ BEGIN { $| = 1; } -use MultiTestDB; -use TestUtils qw(test_getter_setter debug); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor( 'core' ); diff --git a/modules/t/repeatMaskedSlice.t b/modules/t/repeatMaskedSlice.t index ac9f8e14c2..090d77f110 100644 --- a/modules/t/repeatMaskedSlice.t +++ b/modules/t/repeatMaskedSlice.t @@ -1,7 +1,6 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; @@ -9,15 +8,15 @@ BEGIN { $| = 1; plan tests => 6; } -use TestUtils qw( debug ); +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::RepeatMaskedSlice; -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; our $verbose = 0; -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor('core'); diff --git a/modules/t/seqDumper.t b/modules/t/seqDumper.t index 1023f63013..fb6cf716fd 100644 --- a/modules/t/seqDumper.t +++ b/modules/t/seqDumper.t @@ -1,10 +1,9 @@ -use lib 't'; use strict; use warnings; use Bio::EnsEMBL::Utils::SeqDumper; -use TestUtils qw ( debug test_getter_setter ); -use MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; +use Bio::EnsEMBL::Test::MultiTestDB; BEGIN { $| = 1; use Test; @@ -14,7 +13,7 @@ BEGIN { $| = 1; our $verbose = 0; -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor( "core" ); diff --git a/modules/t/seqEdit.t b/modules/t/seqEdit.t index 2315ba1420..44b79a792f 100644 --- a/modules/t/seqEdit.t +++ b/modules/t/seqEdit.t @@ -1,4 +1,3 @@ -use lib 't'; BEGIN { $| = 1; use Test; @@ -7,7 +6,7 @@ BEGIN { $| = 1; use Bio::EnsEMBL::SeqEdit; use Bio::EnsEMBL::Attribute; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::TestUtils; my $code = 'rna edit'; my $desc = 'Post transcriptional RNA edit'; diff --git a/modules/t/sequenceAdaptor.t b/modules/t/sequenceAdaptor.t index 4c776e3c7a..2f4324d32f 100644 --- a/modules/t/sequenceAdaptor.t +++ b/modules/t/sequenceAdaptor.t @@ -1,22 +1,21 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; plan tests => 8; } -use TestUtils qw( debug ); +use Bio::EnsEMBL::Test::TestUtils; -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Slice; our $verbose= 0; -my $multi_db = MultiTestDB->new; +my $multi_db = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi_db->get_DBAdaptor('core'); my $CHR = '20'; diff --git a/modules/t/simpleFeature.t b/modules/t/simpleFeature.t index 918c783a99..2124f87540 100644 --- a/modules/t/simpleFeature.t +++ b/modules/t/simpleFeature.t @@ -1,20 +1,19 @@ use strict; -use lib 't'; -use TestUtils qw(test_getter_setter debug); +use Bio::EnsEMBL::Test::TestUtils; BEGIN { $| = 1; use Test; plan tests => 34; } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::SimpleFeature; our $verbose = 0; -my $multi = MultiTestDB->new; +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new; # get a core DBAdaptor # diff --git a/modules/t/slice.t b/modules/t/slice.t index 8cdc1418b3..f70419b5fd 100644 --- a/modules/t/slice.t +++ b/modules/t/slice.t @@ -1,16 +1,15 @@ use strict; use warnings; -use lib 't'; BEGIN { $| = 1; use Test; plan tests => 53; } -use TestUtils qw( debug ); +use Bio::EnsEMBL::Test::TestUtils; -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::Slice; use Bio::EnsEMBL::ProjectionSegment; @@ -28,7 +27,7 @@ my $END = 31_200_000; my $STRAND = 1; my $SEQ_REGION_LENGTH = 50e6; -my $multi_db = MultiTestDB->new; +my $multi_db = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi_db->get_DBAdaptor('core'); # diff --git a/modules/t/sliceAdaptor.t b/modules/t/sliceAdaptor.t index 3fa1869572..570cf87de0 100644 --- a/modules/t/sliceAdaptor.t +++ b/modules/t/sliceAdaptor.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; use warnings; @@ -8,10 +7,10 @@ BEGIN { $| = 1; plan tests => 65; } -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; use Bio::EnsEMBL::DBSQL::SliceAdaptor; use Bio::EnsEMBL::Slice; -use TestUtils qw(test_getter_setter debug); +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; @@ -22,7 +21,7 @@ my ($CHR, $START, $END, $FLANKING) = ("20", 30_252_000, 31_252_001, 1000); # ok(1); -my $multi = MultiTestDB->new; +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new; my $db = $multi->get_DBAdaptor('core'); diff --git a/modules/t/topLevelAssemblyMapper.t b/modules/t/topLevelAssemblyMapper.t index 95caec343a..0acd0405b6 100644 --- a/modules/t/topLevelAssemblyMapper.t +++ b/modules/t/topLevelAssemblyMapper.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; BEGIN { $| = 1; @@ -6,12 +5,12 @@ BEGIN { $| = 1; plan tests => 7; } -use MultiTestDB; -use TestUtils qw(debug test_getter_setter); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; our $verbose = 0; #set to 1 to turn on debug printouts -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); my $db = $multi->get_DBAdaptor( 'core' ); diff --git a/modules/t/transcript.t b/modules/t/transcript.t index 4ebb2a7f58..9a95c4100d 100644 --- a/modules/t/transcript.t +++ b/modules/t/transcript.t @@ -1,4 +1,3 @@ -use lib 't'; use strict; use warnings; use vars qw( $verbose ); @@ -8,13 +7,13 @@ BEGIN { $| = 1; plan tests => 131; } -use MultiTestDB; -use TestUtils qw( debug test_getter_setter count_rows); +use Bio::EnsEMBL::Test::MultiTestDB; +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Transcript; use Bio::EnsEMBL::Slice; use Bio::EnsEMBL::Intron; -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); $verbose = 0; #set to true to turn on debug print outs diff --git a/modules/t/translation.t b/modules/t/translation.t index 63e3d7b2da..7ce80be53d 100644 --- a/modules/t/translation.t +++ b/modules/t/translation.t @@ -1,8 +1,7 @@ use strict; use warnings; -use lib 't'; -use TestUtils qw(debug test_getter_setter count_rows); +use Bio::EnsEMBL::Test::TestUtils; use Bio::EnsEMBL::Translation; use Bio::EnsEMBL::Exon; @@ -17,9 +16,9 @@ END {print "not ok 1\n" unless $loaded;} #turn on/off debug prints: our $verbose = 0; -use MultiTestDB; +use Bio::EnsEMBL::Test::MultiTestDB; -my $multi = MultiTestDB->new(); +my $multi = Bio::EnsEMBL::Test::MultiTestDB->new(); $loaded = 1; -- GitLab