From 99936d8cd0929e244eba6946ea858154e74f5ca0 Mon Sep 17 00:00:00 2001 From: jason Date: Fri, 8 Jun 2001 16:56:35 +0000 Subject: [PATCH] allow dynamic selection of which dbs we will test svn path=/bioperl-db/trunk/; revision=222 --- t/DBTestHarness.pm | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/t/DBTestHarness.pm b/t/DBTestHarness.pm index 9168333..73a262d 100755 --- a/t/DBTestHarness.pm +++ b/t/DBTestHarness.pm @@ -55,19 +55,32 @@ my $counter=0; ); sub new { - my( $pkg ) = @_; + my( $pkg,$db ) = @_; $counter++; # Get config from file, or use default values - my $self = do 'DBHarness.conf' || { - 'driver' => 'mysql', - 'host' => 'localhost', - 'user' => 'root', - 'port' => undef, - 'password' => undef, - 'schema_sql' => ['./sql/basicseqdb-mysql.sql'], - 'module' => 'Bio::DB::SQL::DBAdaptor' - }; + my $self; + if( ! $db || $db eq 'basicseqdb' ) { + $self = do 'DBHarness.conf' || { + 'driver' => 'mysql', + 'host' => 'localhost', + 'user' => 'root', + 'port' => undef, + 'password' => undef, + 'schema_sql' => ['./sql/basicseqdb-mysql.sql'], + 'module' => 'Bio::DB::SQL::DBAdaptor' + }; + } elsif ( $db eq 'markerdb' ) { + $self = do 'DBHarness.markerdb.conf' || { + 'driver' => 'mysql', + 'host' => 'localhost', + 'user' => 'root', + 'port' => undef, + 'password' => undef, + 'schema_sql' => ['./sql/markerdb.sql'], + 'module' => 'Bio::DB::Map::SQL::DBAdaptor' + }; + } foreach my $f (keys %$self) { confess "Unknown config field: '$f'" unless $known_field{$f}; } -- 2.11.4.GIT