Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make syteny store loading tests skip if no DBI or no DBD::SQLite

  • Loading branch information...
commit 8a393b67e62cb5e9ace5dc0c7788d0fe0de661c4 1 parent f37a8ae
@rbuels rbuels authored
Showing with 49 additions and 48 deletions.
  1. +25 −24 t/synteny_store/load_msa.t
  2. +24 −24 t/synteny_store/load_tabular.t
View
49 t/synteny_store/load_msa.t
@@ -7,36 +7,37 @@ use Bio::DB::Synteny::Store;
use_ok( 'Bio::DB::Synteny::Store::Loader::MSA' );
-my $database_tempfile = File::Temp->new;
-$database_tempfile->close;
-my $store = Bio::DB::Synteny::Store->new(
- -adaptor => 'DBI::SQLite',
- -dsn => "dbi:SQLite:dbname=$database_tempfile",
- -create => 1,
-);
+SKIP: {
+ eval { require DBI; my $s = DBI->connect( 'dbi:SQLite:dbname=:memory:' ) };
+ skip 'DBD::SQLite not available, cannot test', 4 if $@;
-can_ok( $store, 'add_alignment', 'add_map' );
+ my $database_tempfile = File::Temp->new;
+ $database_tempfile->close;
-#system "ls -l $database_tempfile";
+ my $store = Bio::DB::Synteny::Store->new(
+ -adaptor => 'DBI::SQLite',
+ -dsn => "dbi:SQLite:dbname=$database_tempfile",
+ -create => 1,
+ );
-my $loader = Bio::DB::Synteny::Store::Loader::MSA->new(
- -store => $store,
- -format => 'clustalw',
- );
+ can_ok( $store, 'add_alignment', 'add_map' );
-can_ok( $loader, 'load' );
+ my $loader = Bio::DB::Synteny::Store::Loader::MSA->new(
+ -store => $store,
+ -format => 'clustalw',
+ );
-$loader->load( 't/data/rice_subset.aln' );
+ can_ok( $loader, 'load' );
-for (['alignments',8],['map',444]) {
- is(
- $store->dbh->selectrow_arrayref("select count(*) from $_->[0]")->[0],
- $_->[1],
- "got right number of rows in $_->[0] table"
- );
-}
+ $loader->load( 't/data/rice_subset.aln' );
-#system "ls -l $unzipped $database_tempfile";
+ for (['alignments',8],['map',444]) {
+ is(
+ $store->dbh->selectrow_arrayref("select count(*) from $_->[0]")->[0],
+ $_->[1],
+ "got right number of rows in $_->[0] table"
+ );
+ }
-#######
+}
View
48 t/synteny_store/load_tabular.t
@@ -7,35 +7,35 @@ use Bio::DB::Synteny::Store;
use_ok( 'Bio::DB::Synteny::Store::Loader::Tabular' );
-my $database_tempfile = File::Temp->new;
-$database_tempfile->close;
+SKIP: {
+ eval { require DBI; my $s = DBI->connect( 'dbi:SQLite:dbname=:memory:' ) };
+ skip 'DBD::SQLite not available, cannot test', 4 if $@;
-my $store = Bio::DB::Synteny::Store->new(
- -adaptor => 'DBI::SQLite',
- -dsn => "dbi:SQLite:dbname=$database_tempfile",
- -create => 1,
-);
+ my $database_tempfile = File::Temp->new;
+ $database_tempfile->close;
-can_ok( $store, 'add_alignment', 'add_map' );
+ my $store = Bio::DB::Synteny::Store->new(
+ -adaptor => 'DBI::SQLite',
+ -dsn => "dbi:SQLite:dbname=$database_tempfile",
+ -create => 1,
+ );
-#system "ls -l $database_tempfile";
+ can_ok( $store, 'add_alignment', 'add_map' );
-my $loader = Bio::DB::Synteny::Store::Loader::Tabular->new(
- -store => $store,
- );
+ my $loader = Bio::DB::Synteny::Store::Loader::Tabular->new(
+ -store => $store,
+ );
-can_ok( $loader, 'load' );
+ can_ok( $loader, 'load' );
-$loader->load( 't/data/TOMvsPOT.subset.syntab' );
+ $loader->load( 't/data/TOMvsPOT.subset.syntab' );
-for (['alignments',60],['map',0]) {
- is(
- $store->dbh->selectrow_arrayref("select count(*) from $_->[0]")->[0],
- $_->[1],
- "got right number of rows in $_->[0] table"
- );
-}
-
-#system "ls -l $unzipped $database_tempfile";
+ for (['alignments',60],['map',0]) {
+ is(
+ $store->dbh->selectrow_arrayref("select count(*) from $_->[0]")->[0],
+ $_->[1],
+ "got right number of rows in $_->[0] table"
+ );
+ }
-#######
+}
Please sign in to comment.
Something went wrong with that request. Please try again.