$DB_Class = 'BeerDB::BeerTestsqlite';
+$err = undef;
#unlink "t/test.db";
if ( !-e "t/test.db" ) {
eval {make_sqlite_db($sql)};
$err = $@;
if ($err) { print "Skipping sql tests because couldnt make sqlite test db
- because of error $err"; exit; };
+ because of error: $err";};
+}
+unless ($err) {
+ my $driver = sqlite_driver();
+ eval { $DB_Class->connection("dbi:$driver:dbname='t/test.db'");};
+ $err = $@;
}
-my $driver = sqlite_driver();
-eval { $DB_Class->connection("dbi:$driver:dbname='t/test.db'");};
-$err = $@;
-if ($err) { die "CDBI connection error: $err"; }
$skip_msg = "Could not connect to SQLite database 't/test.db'";
$skip_howmany = 13;