use Test::More;
use Test::Exception;
+use DBIx::Class::Optional::Dependencies ();
+
use lib qw(t/lib);
use DBICTest;
-for my $type (qw/PG MYSQL/) {
+plan skip_all => 'Test segfaults on Win32 - investigation pending'
+ if $^O eq 'MSWin32' && DBICTest::RunMode->is_plain;
- SKIP: {
- skip "Skipping $type tests without DBICTEST_${type}_DSN", 1
- unless $ENV{"DBICTEST_${type}_DSN"};
+for my $type (qw/PG MYSQL SQLite/) {
- my $schema = DBICTest::Schema->connect (@ENV{map { "DBICTEST_${type}_${_}" } qw/DSN USER PASS/});
+ SKIP: {
+ my @dsn = $type eq 'SQLite'
+ ? DBICTest->_database(sqlite_use_file => 1)
+ : do {
+ skip "Skipping $type tests without DBICTEST_${type}_DSN", 1
+ unless $ENV{"DBICTEST_${type}_DSN"};
+ @ENV{map { "DBICTEST_${type}_${_}" } qw/DSN USER PASS/}
+ }
+ ;
+
+ if ($type eq 'PG') {
+ skip "skipping Pg tests without dependencies installed", 1
+ unless DBIx::Class::Optional::Dependencies->req_ok_for('test_rdbms_pg');
+ }
+ elsif ($type eq 'MYSQL') {
+ skip "skipping MySQL tests without dependencies installed", 1
+ unless DBIx::Class::Optional::Dependencies->req_ok_for('test_rdbms_mysql');
+ }
+
+ my $schema = DBICTest::Schema->connect (@dsn);
# emulate a singleton-factory, just cache the object *somewhere in a different package*
# to induce out-of-order destruction
}
else {
note "Child $$ terminating";
+ undef $DBICTest::FakeSchemaFactory::schema;
exit 0;
}