Start known issues changelog section - place it on top for clarity
[dbsrgits/DBIx-Class.git] / t / 750firebird.t
index 1d06387..fac50d5 100644 (file)
@@ -1,12 +1,15 @@
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+
 use strict;
 use warnings;
 
 use Test::More;
 use Test::Exception;
 use DBIx::Class::Optional::Dependencies ();
-use Scope::Guard ();
+use DBIx::Class::_Util 'scope_guard';
+use List::Util 'shuffle';
 use Try::Tiny;
-use lib qw(t/lib);
+
 use DBICTest;
 
 my $env2optdep = {
@@ -25,8 +28,6 @@ plan skip_all => join (' ',
   'and "nonpkid_seq" and the trigger "artist_bi".',
 ) unless grep { $ENV{"${_}_DSN"} } keys %$env2optdep;
 
-# tests stolen from 749sybase_asa.t
-
 # Example DSNs:
 # dbi:Firebird:db=/var/lib/firebird/2.5/data/hlaghdb.fdb
 # dbi:InterBase:db=/var/lib/firebird/2.5/data/hlaghdb.fdb
@@ -36,26 +37,13 @@ plan skip_all => join (' ',
 
 my $schema;
 
-my @test_order = map { "DBICTEST_FIREBIRD$_" }
-  DBICTest::RunMode->is_plain
-    ? ('', '_INTERBASE', '_ODBC')   # Least likely to fail
-    : ('_ODBC', '_INTERBASE' , ''); # Most likely to fail
+for my $prefix (shuffle keys %$env2optdep) { SKIP: {
 
-for my $prefix (@test_order) { SKIP: {
+  DBIx::Class::Optional::Dependencies->skip_without( $env2optdep->{$prefix} );
 
   my ($dsn, $user, $pass) = map { $ENV{"${prefix}_$_"} } qw/DSN USER PASS/;
-
-  next unless $dsn;
-
   note "Testing with ${prefix}_DSN";
 
-  skip ("Testing with ${prefix}_DSN needs " . DBIx::Class::Optional::Dependencies->req_missing_for( $env2optdep->{$prefix} ), 1)
-    unless  DBIx::Class::Optional::Dependencies->req_ok_for($env2optdep->{$prefix});
-
-  skip ("DBD::InterBase crashes if Firebird or ODBC are also loaded", 1)
-    if $prefix eq 'DBICTEST_FIREBIRD_INTERBASE' and
-      ($ENV{DBICTEST_FIREBIRD_DSN} or $ENV{DBICTEST_FIREBIRD_ODBC_DSN});
-
   $schema = DBICTest::Schema->connect($dsn, $user, $pass, {
     auto_savepoint  => 1,
     quote_names     => 1,
@@ -63,7 +51,7 @@ for my $prefix (@test_order) { SKIP: {
   });
   my $dbh = $schema->storage->dbh;
 
-  my $sg = Scope::Guard->new(sub { cleanup($schema) });
+  my $sg = scope_guard { cleanup($schema) };
 
   eval { $dbh->do(q[DROP TABLE "artist"]) };
   $dbh->do(<<EOF);