use Test::Exception;
use Try::Tiny;
use File::Path 'rmtree';
+use DBIx::Class::Optional::Dependencies;
use DBIx::Class::Schema::Loader::Utils 'slurp_file';
use DBIx::Class::Schema::Loader 'make_schema_at';
if( !$dsn || !$user ) {
$tester->skip_tests('You need to set the DBICTEST_MYSQL_DSN, DBICTEST_MYSQL_USER, and DBICTEST_MYSQL_PASS environment variables');
}
+elsif (!DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_mysql')) {
+ $tester->skip_tests('You need to install ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_mysql'));
+}
else {
diag $skip_rels_msg if not $test_innodb;
$tester->run_tests();
use strict;
use warnings;
use utf8;
+use DBIx::Class::Optional::Dependencies;
use DBIx::Class::Schema::Loader 'make_schema_at';
use DBIx::Class::Schema::Loader::Utils qw/no_warnings slurp_file/;
use Test::More;
if( !$dsn || !$user ) {
$tester->skip_tests('You need to set the DBICTEST_PG_DSN, _USER, and _PASS environment variables');
}
+elsif (!DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_pg')) {
+ $tester->skip_tests('You need to install ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_pg'));
+}
else {
$tester->run_tests();
}
use Test::Exception;
use Try::Tiny;
use File::Path 'rmtree';
+use DBIx::Class::Optional::Dependencies;
use DBIx::Class::Schema::Loader 'make_schema_at';
use lib qw(t/lib);
plan skip_all => 'You need to set the DBICTEST_DB2_DSN, _USER, and _PASS environment variables'
unless ($dsn && $user);
+plan skip_all => 'You need to install ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_db2')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_db2');
+
my ($schema, $schemas_created); # for cleanup in END for extra tests
my $srv_ver = do {
use warnings;
use Test::More;
use Test::Exception;
+use DBIx::Class::Optional::Dependencies;
use DBIx::Class::Schema::Loader 'make_schema_at';
use DBIx::Class::Schema::Loader::Utils qw/slurp_file split_name/;
use Try::Tiny;
if( !$dsn || !$user ) {
$tester->skip_tests('You need to set the DBICTEST_ORA_DSN, _USER, and _PASS environment variables');
}
+elsif (!DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_oracle')) {
+ $tester->skip_tests('You need to install ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_oracle'));
+}
else {
$tester->run_tests();
}
use Test::Exception;
use Try::Tiny;
use File::Path 'rmtree';
+use DBIx::Class::Optional::Dependencies;
use DBIx::Class::Schema::Loader 'make_schema_at';
use DBIx::Class::Schema::Loader::Utils qw/sigwarn_silencer/;
use namespace::clean;
if( !$dsn || !$user ) {
$tester->skip_tests('You need to set the DBICTEST_SYBASE_DSN, _USER, and _PASS environment variables');
}
+elsif (!DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_ase')) {
+ $tester->skip_tests('You need to install ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_ase'));
+}
else {
$tester->run_tests();
}
use warnings;
use Test::More;
use Test::Exception;
+use DBIx::Class::Optional::Dependencies;
use DBIx::Class::Schema::Loader::Utils qw/warnings_exist_silent sigwarn_silencer/;
use Try::Tiny;
use File::Path 'rmtree';
for (qw/MSSQL MSSQL_ODBC MSSQL_ADO/) {
next unless $ENV{"DBICTEST_${_}_DSN"};
+ (my $dep_group = lc "rdbms_$_") =~ s/mssql$/mssql_sybase/;
+ if (!DBIx::Class::Optional::Dependencies->req_ok_for($dep_group)) {
+ diag 'You need to install ' . DBIx::Class::Optional::Dependencies->req_missing_for($dep_group)
+ . " to test with $_";
+ next;
+ }
+
$dsns->{$_}{dsn} = $ENV{"DBICTEST_${_}_DSN"};
$dsns->{$_}{user} = $ENV{"DBICTEST_${_}_USER"};
$dsns->{$_}{password} = $ENV{"DBICTEST_${_}_PASS"};
use Test::Exception;
use Try::Tiny;
use File::Path 'rmtree';
+use DBIx::Class::Optional::Dependencies;
use DBIx::Class::Schema::Loader 'make_schema_at';
use Scope::Guard ();
#
# Setting them to zero is preferred.
-my $dbd_sqlanywhere_dsn = $ENV{DBICTEST_SQLANYWHERE_DSN} || '';
-my $dbd_sqlanywhere_user = $ENV{DBICTEST_SQLANYWHERE_USER} || '';
-my $dbd_sqlanywhere_password = $ENV{DBICTEST_SQLANYWHERE_PASS} || '';
+my %dsns;
+for (qw(SQLANYWHERE SQLANYWHERE_ODBC)) {
+ next unless $ENV{"DBICTEST_${_}_DSN"};
-my $odbc_dsn = $ENV{DBICTEST_SQLANYWHERE_ODBC_DSN} || '';
-my $odbc_user = $ENV{DBICTEST_SQLANYWHERE_ODBC_USER} || '';
-my $odbc_password = $ENV{DBICTEST_SQLANYWHERE_ODBC_PASS} || '';
+ my $dep_group = lc "rdbms_$_";
+ if (!DBIx::Class::Optional::Dependencies->req_ok_for($dep_group)) {
+ diag 'You need to install ' . DBIx::Class::Optional::Dependencies->req_missing_for($dep_group)
+ . " to test with $_";
+ next;
+ }
+
+ $dsns{$_}{dsn} = $ENV{"DBICTEST_${_}_DSN"};
+ $dsns{$_}{user} = $ENV{"DBICTEST_${_}_USER"};
+ $dsns{$_}{password} = $ENV{"DBICTEST_${_}_PASS"};
+};
+
+plan skip_all => 'You need to set the DBICTEST_SQLANYWHERE_DSN, _USER and _PASS and/or the DBICTEST_SQLANYWHERE_ODBC_DSN, _USER and _PASS environment variables'
+ unless %dsns;
my ($schema, $schemas_created); # for cleanup in END for extra tests
my $tester = dbixcsl_common_tests->new(
vendor => 'SQLAnywhere',
auto_inc_pk => 'INTEGER IDENTITY NOT NULL PRIMARY KEY',
- connect_info => [ ($dbd_sqlanywhere_dsn ? {
- dsn => $dbd_sqlanywhere_dsn,
- user => $dbd_sqlanywhere_user,
- password => $dbd_sqlanywhere_password,
- } : ()),
- ($odbc_dsn ? {
- dsn => $odbc_dsn,
- user => $odbc_user,
- password => $odbc_password,
- } : ()),
- ],
+ connect_info => [ values %dsns ],
loader_options => { preserve_case => 1 },
default_is_deferrable => 1,
default_on_clause => 'RESTRICT',
},
);
-if (not ($dbd_sqlanywhere_dsn || $odbc_dsn)) {
- $tester->skip_tests('You need to set the DBICTEST_SQLANYWHERE_DSN, _USER and _PASS and/or the DBICTEST_SQLANYWHERE_ODBC_DSN, _USER and _PASS environment variables');
-}
-else {
- $tester->run_tests();
-}
+$tester->run_tests();
sub extra_cleanup {
if (not $ENV{SCHEMA_LOADER_TESTS_NOCLEANUP}) {
use warnings;
use Test::More;
use Scope::Guard ();
+use DBIx::Class::Optional::Dependencies;
use DBIx::Class::Schema::Loader::Utils qw/sigwarn_silencer/;
use lib qw(t/lib);
use dbixcsl_common_tests;
-my $dbd_firebird_dsn = $ENV{DBICTEST_FIREBIRD_DSN} || '';
-my $dbd_firebird_user = $ENV{DBICTEST_FIREBIRD_USER} || '';
-my $dbd_firebird_password = $ENV{DBICTEST_FIREBIRD_PASS} || '';
+my %dsns;
+for (qw(FIREBIRD FIREBIRD_ODBC FIREBIRD_INTERBASE)) {
+ next unless $ENV{"DBICTEST_${_}_DSN"};
-my $dbd_interbase_dsn = $ENV{DBICTEST_FIREBIRD_INTERBASE_DSN} || '';
-my $dbd_interbase_user = $ENV{DBICTEST_FIREBIRD_INTERBASE_USER} || '';
-my $dbd_interbase_password = $ENV{DBICTEST_FIREBIRD_INTERBASE_PASS} || '';
+ my $dep_group = lc "rdbms_$_";
+ if (!DBIx::Class::Optional::Dependencies->req_ok_for($dep_group)) {
+ diag 'You need to install ' . DBIx::Class::Optional::Dependencies->req_missing_for($dep_group)
+ . " to test with $_";
+ next;
+ }
+
+ $dsns{$_}{dsn} = $ENV{"DBICTEST_${_}_DSN"};
+ $dsns{$_}{user} = $ENV{"DBICTEST_${_}_USER"};
+ $dsns{$_}{password} = $ENV{"DBICTEST_${_}_PASS"};
+ $dsns{$_}{connect_info_opts} = { on_connect_call => 'use_softcommit' }
+ if /\AFIREBIRD(?:_INTERBASE)\z/;
+};
-my $odbc_dsn = $ENV{DBICTEST_FIREBIRD_ODBC_DSN} || '';
-my $odbc_user = $ENV{DBICTEST_FIREBIRD_ODBC_USER} || '';
-my $odbc_password = $ENV{DBICTEST_FIREBIRD_ODBC_PASS} || '';
+plan skip_all => 'You need to set the DBICTEST_FIREBIRD_DSN, _USER and _PASS and/or the DBICTEST_FIREBIRD_ODBC_DSN, _USER and _PASS and/or the DBICTEST_FIREBIRD_INTERBASE_DSN, _USER and _PASS environment variables'
+ unless %dsns;
my $schema;
null => '',
preserve_case_mode_is_exclusive => 1,
quote_char => '"',
- connect_info => [
- ($dbd_firebird_dsn ? {
- dsn => $dbd_firebird_dsn,
- user => $dbd_firebird_user,
- password => $dbd_firebird_password,
- connect_info_opts => { on_connect_call => 'use_softcommit' },
- } : ()),
- ($dbd_interbase_dsn ? {
- dsn => $dbd_interbase_dsn,
- user => $dbd_interbase_user,
- password => $dbd_interbase_password,
- connect_info_opts => { on_connect_call => 'use_softcommit' },
- } : ()),
- ($odbc_dsn ? {
- dsn => $odbc_dsn,
- user => $odbc_user,
- password => $odbc_password,
- } : ()),
- ],
+ connect_info => [ values %dsns ],
data_types => {
# based on the Interbase Data Definition Guide
# http://www.ibphoenix.com/downloads/60DataDef.zip
},
);
-if (not ($dbd_firebird_dsn || $dbd_interbase_dsn || $odbc_dsn)) {
- $tester->skip_tests('You need to set the DBICTEST_FIREBIRD_DSN, _USER and _PASS and/or the DBICTEST_FIREBIRD_INTERBASE_DSN and/or the DBICTEST_FIREBIRD_ODBC_DSN environment variables');
-}
-else {
+{
# get rid of stupid warning from InterBase/GetInfo.pm
- if ($dbd_interbase_dsn) {
+ if ($dsns{FIREBIRD_INTERBASE}) {
local $SIG{__WARN__} = sigwarn_silencer(
qr{^Use of uninitialized value in sprintf at \S+DBD/InterBase/GetInfo\.pm line \d+\.$|^Missing argument in sprintf at \S+DBD/InterBase/GetInfo.pm line \d+\.$}
);
use Test::Exception;
use Try::Tiny;
use File::Path 'rmtree';
+use DBIx::Class::Optional::Dependencies;
use DBIx::Class::Schema::Loader 'make_schema_at';
use DBIx::Class::Schema::Loader::Utils 'split_name';
use String::ToIdentifier::EN::Unicode 'to_identifier';
if( !$dsn ) {
$tester->skip_tests('You need to set the DBICTEST_INFORMIX_DSN, _USER, and _PASS environment variables');
}
+elsif (!DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_informix')) {
+ $tester->skip_tests('You need to install ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_informix'));
+}
else {
$tester->run_tests();
}
use strict;
use warnings;
use Test::More;
+use DBIx::Class::Optional::Dependencies;
use DBIx::Class::Schema::Loader::DBI::ODBC::ACCESS ();
use lib qw(t/lib);
use dbixcsl_common_tests;
-my $odbc_dsn = $ENV{DBICTEST_MSACCESS_ODBC_DSN} || '';
-my $odbc_user = $ENV{DBICTEST_MSACCESS_ODBC_USER} || '';
-my $odbc_password = $ENV{DBICTEST_MSACCESS_ODBC_PASS} || '';
+my %dsns;
+for (qw(MSACCESS_ODBC MSACCESS_ADO)) {
+ next unless $ENV{"DBICTEST_${_}_DSN"};
-my $ado_dsn = $ENV{DBICTEST_MSACCESS_ADO_DSN} || '';
-my $ado_user = $ENV{DBICTEST_MSACCESS_ADO_USER} || '';
-my $ado_password = $ENV{DBICTEST_MSACCESS_ADO_PASS} || '';
+ my $dep_group = lc "rdbms_$_";
+ if (!DBIx::Class::Optional::Dependencies->req_ok_for($dep_group)) {
+ diag 'You need to install ' . DBIx::Class::Optional::Dependencies->req_missing_for($dep_group)
+ . " to test with $_";
+ next;
+ }
+
+ $dsns{$_}{dsn} = $ENV{"DBICTEST_${_}_DSN"};
+ $dsns{$_}{user} = $ENV{"DBICTEST_${_}_USER"};
+ $dsns{$_}{password} = $ENV{"DBICTEST_${_}_PASS"};
+};
+
+plan skip_all => 'You need to set the DBICTEST_MSACCESS_ODBC_DSN, _USER and _PASS and/or the DBICTEST_MSACCESS_ADO_DSN, _USER and _PASS environment variables'
+ unless %dsns;
my %ado_extra_types = (
'tinyint' => { data_type => 'tinyint', original => { data_type => 'byte' } },
vendor => 'Access',
auto_inc_pk => 'AUTOINCREMENT PRIMARY KEY',
quote_char => [qw/[ ]/],
- connect_info => [ ($odbc_dsn ? {
- dsn => $odbc_dsn,
- user => $odbc_user,
- password => $odbc_password,
- } : ()),
- ($ado_dsn ? {
- dsn => $ado_dsn,
- user => $ado_user,
- password => $ado_password,
- } : ()),
- ],
+ connect_info => [ values %dsns ],
data_types => {
# http://msdn.microsoft.com/en-us/library/bb208866(v=office.12).aspx
#
package DBIXCSL_Test::DummySchema;
use base 'DBIx::Class::Schema';
}
- my @connect_info = $odbc_dsn ? ($odbc_dsn, $odbc_user, $odbc_password)
- : ($ado_dsn, $ado_user, $ado_password);
+ my @connect_info = @{$dsns{MSACCESS_ODBC} || $dsns{MSACCESS_ADO}};
my $schema = DBIXCSL_Test::DummySchema->connect(@connect_info);
},
);
-if (not ($odbc_dsn || $ado_dsn)) {
- $tester->skip_tests('You need to set the DBICTEST_MSACCESS_ODBC_DSN, and optionally _USER and _PASS and/or the DBICTEST_MSACCESS_ADO_DSN, and optionally _USER and _PASS environment variables');
-}
-else {
- $tester->run_tests();
-}
+$tester->run_tests();
# vim:et sts=4 sw=4 tw=0: