use DBICTest;
use DBIx::Class::Optional::Dependencies ();
+# set early - used in END
my $main_pid = $$;
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_pg')
- unless DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_pg');
-
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/};
plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
. ' (note: creates and drops a table named artist!)' unless ($dsn && $user);
+plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_pg')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_pg');
+
# README: If you set the env var to a number greater than 10,
# we will use that many children
my $num_children = $ENV{DBICTEST_FORK_STRESS} || 1;
+# README: If you set the env var DBICTEST_THREAD_STRESS to a number greater
+# than 10, we will use that many children
+
+use strict;
+use warnings;
use Config;
+
BEGIN {
- unless ($Config{useithreads}) {
- print "1..0 # SKIP your perl does not support ithreads\n";
- exit 0;
+ my $err;
+
+ if (! $Config{useithreads}) {
+ $err = 'your perl does not support ithreads';
+ }
+ elsif ($] < '5.008005') {
+ $err = 'DBIC does not actively support threads before perl 5.8.5';
+ }
+ elsif ($INC{'Devel/Cover.pm'}) {
+ $err = 'Devel::Cover does not work with threads yet';
}
- if ($INC{'Devel/Cover.pm'}) {
- print "1..0 # SKIP Devel::Cover does not work with threads yet\n";
+ if ($err) {
+ print "1..0 # SKIP $err\n";
exit 0;
}
}
-use threads;
-use strict;
-use warnings;
+use threads; # must be loaded before Test::More
use Test::More;
use lib qw(t/lib);
use DBICTest;
-plan skip_all => 'DBIC does not actively support threads before perl 5.8.5'
- if $] < '5.008005';
-
plan skip_all => 'Potential problems on Win32 Perl < 5.14 and Variable::Magic - investigation pending'
if $^O eq 'MSWin32' && $] < 5.014 && DBICTest::RunMode->is_plain;
-# README: If you set the env var to a number greater than 10,
-# we will use that many children
my $num_children = $ENV{DBICTEST_THREAD_STRESS} || 1;
if($num_children !~ /^[0-9]+$/ || $num_children < 10) {
$num_children = 10;
+# README: If you set the env var DBICTEST_THREAD_STRESS to a number greater
+# than 10, we will use that many children
+
+use strict;
+use warnings;
use Config;
+
BEGIN {
- unless ($Config{useithreads}) {
- print "1..0 # SKIP your perl does not support ithreads\n";
- exit 0;
+ my $err;
+
+ if (! $Config{useithreads}) {
+ $err = 'your perl does not support ithreads';
+ }
+ elsif ($] < '5.008005') {
+ $err = 'DBIC does not actively support threads before perl 5.8.5';
+ }
+ elsif ($INC{'Devel/Cover.pm'}) {
+ $err = 'Devel::Cover does not work with threads yet';
}
- if ($INC{'Devel/Cover.pm'}) {
- print "1..0 # SKIP Devel::Cover does not work with threads yet\n";
+ if ($err) {
+ print "1..0 # SKIP $err\n";
exit 0;
}
}
-use threads;
-
-use strict;
-use warnings;
+use threads; # must be loaded before Test::More
use Test::More;
use Test::Exception;
-plan skip_all => 'DBIC does not actively support threads before perl 5.8.5'
- if $] < '5.008005';
-
use DBIx::Class::Optional::Dependencies ();
use lib qw(t/lib);
use DBICTest;
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_pg')
- unless DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_pg');
-
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/};
plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
. ' (note: creates and drops a table named artist!)' unless ($dsn && $user);
-# README: If you set the env var to a number greater than 10,
-# we will use that many children
+plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_pg')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_pg');
+
my $num_children = $ENV{DBICTEST_THREAD_STRESS} || 1;
if($num_children !~ /^[0-9]+$/ || $num_children < 10) {
$num_children = 10;
}
-use_ok('DBICTest::Schema');
-
my $schema = DBICTest::Schema->connect($dsn, $user, $pass, { AutoCommit => 1, RaiseError => 1, PrintError => 0 });
my $parent_rs;
-# README: If you set the env var to a number greater than 10,
-# we will use that many children
+# README: If you set the env var DBICTEST_THREAD_STRESS to a number greater
+# than 10, we will use that many children
+use strict;
+use warnings;
use Config;
+
BEGIN {
- unless ($Config{useithreads}) {
- print "1..0 # SKIP your perl does not support ithreads\n";
- exit 0;
+ my $err;
+
+ if (! $Config{useithreads}) {
+ $err = 'your perl does not support ithreads';
+ }
+ elsif ($] < '5.008005') {
+ $err = 'DBIC does not actively support threads before perl 5.8.5';
+ }
+ elsif ($INC{'Devel/Cover.pm'}) {
+ $err = 'Devel::Cover does not work with threads yet';
}
- if ($INC{'Devel/Cover.pm'}) {
- print "1..0 # SKIP Devel::Cover does not work with threads yet\n";
+ if ($err) {
+ print "1..0 # SKIP $err\n";
exit 0;
}
}
-use threads;
-
-use strict;
-use warnings;
+use threads; # must be loaded before Test::More
use Test::More;
-plan skip_all => 'DBIC does not actively support threads before perl 5.8.5'
- if $] < '5.008005';
-
use DBIx::Class::Optional::Dependencies ();
use Scalar::Util 'weaken';
use lib qw(t/lib);
plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_pg')
unless DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_pg');
+# README: If you set the env var DBICTEST_THREAD_STRESS to a number greater
+# than 10, we will use that many children
my $num_children = $ENV{DBICTEST_THREAD_STRESS} || 1;
if($num_children !~ /^[0-9]+$/ || $num_children < 10) {
$num_children = 10;
}
-use_ok('DBICTest::Schema');
-
my $schema = DBICTest::Schema->connect($dsn, $user, $pass, { AutoCommit => 1, RaiseError => 1, PrintError => 0 });
my $parent_rs;
use lib qw(t/lib);
use DBICTest;
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_mysql')
- unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_mysql');
-
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MYSQL_${_}" } qw/DSN USER PASS/};
plan skip_all => 'Set $ENV{DBICTEST_MYSQL_DSN}, _USER and _PASS to run this test'
unless ($dsn && $user);
+plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_mysql')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_mysql');
+
my $schema = DBICTest::Schema->connect($dsn, $user, $pass, { quote_names => 1 });
my $dbh = $schema->storage->dbh;
use SQL::Abstract 'is_literal_value';
use DBIx::Class::_Util 'is_exception';
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_pg')
- unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_pg');
-
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/};
-plan skip_all => <<'EOM' unless $dsn && $user;
-Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test
-( NOTE: This test drops and creates tables called 'artist', 'cd',
-'timestamp_primary_key_test', 'track', 'casecheck', 'array_test' and
-'sequence_test' as well as following sequences: 'pkid1_seq', 'pkid2_seq' and
-'nonpkid_seq'. as well as following schemas: 'dbic_t_schema',
-'dbic_t_schema_2', 'dbic_t_schema_3', 'dbic_t_schema_4', and 'dbic_t_schema_5')
-EOM
+plan skip_all =>
+ 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test '
+. "( NOTE: This test drops and creates tables called 'artist', 'cd', "
+. "'timestamp_primary_key_test', 'track', 'casecheck', 'array_test' and "
+. "'sequence_test', the following sequences: 'pkid1_seq', 'pkid2_seq' "
+. "and 'nonpkid_seq' and the following schemas: 'dbic_t_schema', "
+. "'dbic_t_schema_2', 'dbic_t_schema_3', 'dbic_t_schema_4', and "
+. "'dbic_t_schema_5')"
+unless $dsn && $user;
+
+plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_pg')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_pg');
### load any test classes that are defined further down in the file via BEGIN blocks
use lib qw(t/lib);
use DBICTest;
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_pg')
- unless DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_pg');
-
my ($dsn, $dbuser, $dbpass) = @ENV{map { "DBICTEST_PG_${_}" } qw/DSN USER PASS/};
plan skip_all => 'Set $ENV{DBICTEST_PG_DSN}, _USER and _PASS to run this test'
unless ($dsn && $dbuser);
-my $schema = DBICTest::Schema->connect($dsn, $dbuser, $dbpass, { AutoCommit => 1 });
+plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_pg')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_pg');
+
+my $schema = DBICTest::Schema->connect( $dsn, $dbuser, $dbpass );
if ($schema->storage->_server_info->{normalized_dbms_version} >= 9.0) {
if (not try { DBD::Pg->VERSION('2.17.2') }) {
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_ORA_${_}" } qw/DSN USER PASS/};
plan skip_all => 'Set $ENV{DBICTEST_ORA_DSN}, _USER and _PASS to run this test.'
- unless ($dsn && $user && $pass);
+ unless ($dsn && $user);
plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('rdbms_oracle')
unless DBIx::Class::Optional::Dependencies->req_ok_for ('rdbms_oracle');
use lib qw(t/lib);
use DBICTest;
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_db2')
- unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_db2');
-
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_DB2_${_}" } qw/DSN USER PASS/};
-#warn "$dsn $user $pass";
-
plan skip_all => 'Set $ENV{DBICTEST_DB2_DSN}, _USER and _PASS to run this test'
unless ($dsn && $user);
+plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_db2')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_db2');
+
my $schema = DBICTest::Schema->connect($dsn, $user, $pass);
my $name_sep = $schema->storage->_dbh_get_info('SQL_QUALIFIER_NAME_SEPARATOR');
use lib qw(t/lib);
use DBICTest;
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_db2_400')
- unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_db2_400');
-
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_DB2_400_${_}" } qw/DSN USER PASS/};
-#warn "$dsn $user $pass";
-
# Probably best to pass the DBQ option in the DSN to specify a specific
# libray. Something like:
# DBICTEST_DB2_400_DSN='dbi:ODBC:dsn=MyAS400;DBQ=MYLIB'
plan skip_all => 'Set $ENV{DBICTEST_DB2_400_DSN}, _USER and _PASS to run this test'
unless ($dsn && $user);
+plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_db2_400')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_db2_400');
+
plan tests => 6;
my $schema = DBICTest::Schema->connect($dsn, $user, $pass);
use Test::Exception;
use Try::Tiny;
-use DBIx::Class::Optional::Dependencies ();
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_mssql_odbc')
- unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_mssql_odbc');
-
use lib qw(t/lib);
use DBICTest;
plan skip_all => 'Set $ENV{DBICTEST_MSSQL_ODBC_DSN}, _USER and _PASS to run this test'
unless ($dsn && $user);
+use DBIx::Class::Optional::Dependencies ();
+plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_mssql_odbc')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_mssql_odbc');
+
{
my $srv_ver = DBICTest::Schema->connect($dsn, $user, $pass)->storage->_server_info->{dbms_version};
ok ($srv_ver, 'Got a test server version on fresh schema: ' . ($srv_ver||'???') );
# test _insert_bulk using populate.
SKIP: {
- skip '_insert_bulk not supported', 4
+ skip '_insert_bulk not supported', 1
unless $storage_type !~ /NoBindVars/i;
lives_ok {
# make sure _insert_bulk works a second time on the same connection
SKIP: {
- skip '_insert_bulk not supported', 3
+ skip '_insert_bulk not supported', 1
unless $storage_type !~ /NoBindVars/i;
lives_ok {
# now test _insert_bulk with IDENTITY_INSERT
SKIP: {
- skip '_insert_bulk not supported', 3
+ skip '_insert_bulk not supported', 1
unless $storage_type !~ /NoBindVars/i;
lives_ok {
});
is $subq_rs->count, 11, 'correlated subquery';
-# mostly stolen from the blob stuff Nniuq wrote for t/73oracle.t
SKIP: {
- skip 'TEXT/IMAGE support does not work with FreeTDS', 22
+ skip 'TEXT/IMAGE support does not work with FreeTDS', 1
if $schema->storage->_using_freetds;
my $dbh = $schema->storage->_dbh;
# now try _insert_bulk with blobs and a non-blob which also happens to be an
# identity column
SKIP: {
- skip 'no _insert_bulk without placeholders', 4
+ skip 'no _insert_bulk without placeholders', 1
if $storage_type =~ /NoBindVars/i;
$rs->delete;
use lib qw(t/lib);
use DBICTest;
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_mssql_ado')
- unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_mssql_ado');
-
# Example DSN (from frew):
# dbi:ADO:PROVIDER=sqlncli10;SERVER=tcp:172.24.2.10;MARS Connection=True;Initial Catalog=CIS;UID=cis_web;PWD=...;DataTypeCompatibility=80;
-
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_MSSQL_ADO_${_}" } qw/DSN USER PASS/};
plan skip_all => 'Set $ENV{DBICTEST_MSSQL_ADO_DSN}, _USER and _PASS to run this test'
unless ($dsn && $user);
+plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_mssql_ado')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_mssql_ado');
+
DBICTest::Schema->load_classes(qw/VaryingMAX ArtistGUID/);
my %binstr = ( 'small' => join('', map { chr($_) } ( 1 .. 127 )) );
use lib qw(t/lib);
use DBICTest;
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_informix')
- unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_informix');
-
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_INFORMIX_${_}" } qw/DSN USER PASS/};
-#warn "$dsn $user $pass";
-
plan skip_all => 'Set $ENV{DBICTEST_INFORMIX_DSN}, _USER and _PASS to run this test'
unless $dsn;
+plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_informix')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_informix');
+
my $schema = DBICTest::Schema->connect($dsn, $user, $pass, {
auto_savepoint => 1
});
use lib qw(t/lib);
use DBICTest;
-my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_SQLANYWHERE_${_}" } qw/DSN USER PASS/};
-my ($dsn2, $user2, $pass2) = @ENV{map { "DBICTEST_SQLANYWHERE_ODBC_${_}" } qw/DSN USER PASS/};
-
-plan skip_all => 'Test needs ' .
- (join ' or ', map { $_ ? $_ : () }
- DBIx::Class::Optional::Dependencies->req_missing_for('test_rdbms_sqlanywhere'),
- DBIx::Class::Optional::Dependencies->req_missing_for('test_rdbms_sqlanywhere_odbc'))
- unless
- $dsn && DBIx::Class::Optional::Dependencies->req_ok_for('test_rdbms_sqlanywhere')
- or
- $dsn2 && DBIx::Class::Optional::Dependencies->req_ok_for('test_rdbms_sqlanywhere_odbc')
- or
- (not $dsn || $dsn2);
+my $env2optdep = {
+ DBICTEST_SQLANYWHERE => 'test_rdbms_sqlanywhere',
+ DBICTEST_SQLANYWHERE_ODBC => 'test_rdbms_sqlanywhere_odbc',
+};
-DBICTest::Schema->load_classes('ArtistGUID');
+plan skip_all => join (' ',
+ 'Set $ENV{DBICTEST_SQLANYWHERE_DSN} and/or $ENV{DBICTEST_SQLANYWHERE_ODBC_DSN},',
+ '_USER and _PASS to run these tests.',
-# tests stolen from 748informix.t
+ 'WARNING: this test creates and drops the tables "artist", "bindtype_test" and',
+ '"sequence_test"; the generators "gen_artist_artistid", "pkid1_seq", "pkid2_seq"',
+ 'and "nonpkid_seq" and the trigger "artist_bi".',
+) unless grep { $ENV{"${_}_DSN"} } keys %$env2optdep;
-plan skip_all => <<'EOF' unless $dsn || $dsn2;
-Set $ENV{DBICTEST_SQLANYWHERE_DSN} and/or $ENV{DBICTEST_SQLANYWHERE_ODBC_DSN},
-_USER and _PASS to run these tests
-EOF
+my $schema;
+
+DBICTest::Schema->load_classes('ArtistGUID');
-my @info = (
- [ $dsn, $user, $pass ],
- [ $dsn2, $user2, $pass2 ],
-);
+for my $prefix (keys %$env2optdep) { SKIP: {
-my $schema;
+ my ($dsn, $user, $pass) = map { $ENV{"${prefix}_$_"} } qw/DSN USER PASS/;
-foreach my $info (@info) {
- my ($dsn, $user, $pass) = @$info;
+ note "Testing with ${prefix}_DSN";
- next unless $dsn;
+ skip ("Skipping ${prefix}_DSN tests - envvar not set", 1 )
+ unless $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});
$schema = DBICTest::Schema->connect($dsn, $user, $pass, {
auto_savepoint => 1
'empty insert works';
}
-# test blobs (stolen from 73oracle.t)
+# test blobs
eval { $dbh->do('DROP TABLE bindtype_test') };
$dbh->do(qq[
CREATE TABLE bindtype_test
is try { $row_from_db->a_guid }, $row->a_guid,
'NON-PK GUID round trip (via ->search->all)';
}
-}
+}}
done_testing;
use lib qw(t/lib);
use DBICTest;
+# Example DSNs:
+# dbi:Firebird:db=/var/lib/firebird/2.5/data/hlaghdb.fdb
+# dbi:InterBase:db=/var/lib/firebird/2.5/data/hlaghdb.fdb
+
+# Example ODBC DSN:
+# dbi:ODBC:Driver=Firebird;Dbname=/var/lib/firebird/2.5/data/hlaghdb.fdb
+
my $env2optdep = {
DBICTEST_FIREBIRD => 'test_rdbms_firebird',
DBICTEST_FIREBIRD_INTERBASE => 'test_rdbms_firebird_interbase',
'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
-
-# Example ODBC DSN:
-# dbi:ODBC:Driver=Firebird;Dbname=/var/lib/firebird/2.5/data/hlaghdb.fdb
-
my $schema;
for my $prefix (keys %$env2optdep) { SKIP: {
my ($dsn, $user, $pass) = map { $ENV{"${prefix}_$_"} } qw/DSN USER PASS/;
- next unless $dsn;
-
note "Testing with ${prefix}_DSN";
+ skip ("Skipping ${prefix}_DSN tests - envvar not set", 1 )
+ unless $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});
if $schema->storage->dbh->{CachedKids}{$_}->FETCH('Active');
}
-# test blobs (stolen from 73oracle.t)
+# test blobs
eval { $dbh->do('DROP TABLE "bindtype_test"') };
$dbh->do(q[
CREATE TABLE "bindtype_test"
my ($dsn2, $user2, $pass2) = @ENV{map { "DBICTEST_MSACCESS_ADO_${_}" } qw/DSN USER PASS/};
plan skip_all => 'Test needs ' .
- (join ' or ', map { $_ ? $_ : () }
+ (join ' and/or ', map { $_ ? $_ : () }
DBIx::Class::Optional::Dependencies->req_missing_for('test_rdbms_msaccess_odbc'),
DBIx::Class::Optional::Dependencies->req_missing_for('test_rdbms_msaccess_ado'))
- unless
+ unless (
+ (not $dsn || $dsn2)
+ or
$dsn && DBIx::Class::Optional::Dependencies->req_ok_for('test_rdbms_msaccess_odbc')
- or
+ or
$dsn2 && DBIx::Class::Optional::Dependencies->req_ok_for('test_rdbms_msaccess_ado')
- or
- (not $dsn || $dsn2);
+ );
DBICTest::Schema->load_classes('ArtistGUID');
is $row->artistid, $current_artistid+2,
'autoincrement column functional aftear empty insert';
-# test blobs (stolen from 73oracle.t)
-
-# turn off horrendous binary DBIC_TRACE output
+# test blobs
{
+ # turn off horrendous binary DBIC_TRACE output
local $schema->storage->{debug} = 0;
eval { local $^W = 0; $dbh->do('DROP TABLE bindtype_test') };
my ($dsn, $user, $pass) = map { $ENV{"${prefix}_$_"} } qw/DSN USER PASS/;
- next unless $dsn;
-
note "Testing with ${prefix}_DSN";
+ skip ("Skipping ${prefix}_DSN tests - envvar not set", 1 )
+ unless $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});
use DBICTest;
use Scope::Guard ();
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_dt')
-. ' and ' .
-DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_informix')
- unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_dt')
- && DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_informix');
-
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_INFORMIX_${_}" } qw/DSN USER PASS/};
-if (not $dsn) {
- plan skip_all => <<'EOF';
-Set $ENV{DBICTEST_INFORMIX_DSN} _USER and _PASS to run this test'.
-Warning: This test drops and creates a table called 'event'";
-EOF
-}
+if (not $dsn) { plan skip_all => join(' ',
+ 'Set $ENV{DBICTEST_INFORMIX_DSN} _USER and _PASS to run this test',
+ "Warning: This test drops and creates a table called 'event'",
+)}
+
+plan skip_all => 'Test needs ' . join (' and ', map { $_ ? $_ : () } (
+ DBIx::Class::Optional::Dependencies->req_missing_for ('test_dt'),
+ DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_informix'),
+) )
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_dt')
+ && DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_informix');
my $schema;
my ($dsn2, $user2, $pass2) = @ENV{map { "DBICTEST_MSACCESS_ADO_${_}" } qw/DSN USER PASS/};
plan skip_all => 'Test needs ' .
- (join ' and ', map { $_ ? $_ : () }
+ (join ' and one or both of ', map { $_ ? $_ : () }
DBIx::Class::Optional::Dependencies->req_missing_for('test_dt'),
(join ' or ', map { $_ ? $_ : () }
DBIx::Class::Optional::Dependencies->req_missing_for('test_rdbms_msaccess_odbc'),
my ($dsn3, $user3, $pass3) = @ENV{map { "DBICTEST_MSSQL_ADO_${_}" } qw/DSN USER PASS/};
plan skip_all => 'Test needs ' .
- (join ' and ', map { $_ ? $_ : () }
+ (join ' and one or more of ', map { $_ ? $_ : () }
DBIx::Class::Optional::Dependencies->req_missing_for('test_dt'),
(join ' or ', map { $_ ? $_ : () }
DBIx::Class::Optional::Dependencies->req_missing_for('test_rdbms_mssql_odbc'),
use lib qw(t/lib);
use DBICTest;
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_oracle')
- unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_oracle');
-
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_ORA_${_}" } qw/DSN USER PASS/};
if (not ($dsn && $user && $pass)) {
'Warning: This test drops and creates a table called \'event\'';
}
+plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_oracle')
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_oracle');
+
+
# DateTime::Format::Oracle needs this set
$ENV{NLS_DATE_FORMAT} = 'DD-MON-YY';
$ENV{NLS_TIMESTAMP_FORMAT} = 'YYYY-MM-DD HH24:MI:SSXFF';
my ($dsn2, $user2, $pass2) = @ENV{map { "DBICTEST_SQLANYWHERE_ODBC_${_}" } qw/DSN USER PASS/};
plan skip_all => 'Test needs ' .
- (join ' and ', map { $_ ? $_ : () }
+ (join ' and one or both of ', map { $_ ? $_ : () }
DBIx::Class::Optional::Dependencies->req_missing_for('test_dt'),
(join ' or ', map { $_ ? $_ : () }
DBIx::Class::Optional::Dependencies->req_missing_for('test_rdbms_sqlanywhere'),
use lib qw(t/lib);
use DBICTest;
-plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_dt')
-. ' and ' .
-DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_ase')
- unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_dt')
- && DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_ase');
-
my ($dsn, $user, $pass) = @ENV{map { "DBICTEST_SYBASE_${_}" } qw/DSN USER PASS/};
-if (not ($dsn && $user)) {
- plan skip_all =>
- 'Set $ENV{DBICTEST_SYBASE_DSN}, _USER and _PASS to run this test' .
- "\nWarning: This test drops and creates a table called 'track' and " .
- "'event_small_dt'";
-}
+if (not ($dsn && $user)) { plan skip_all => join(' ',
+ 'Set $ENV{DBICTEST_SYBASE_DSN}, _USER and _PASS to run this test',
+ "Warning: This test drops and creates a table called 'track' and ",
+ "'event_small_dt'",
+) }
+
+plan skip_all => 'Test needs ' . join (' and ', map { $_ ? $_ : () } (
+ DBIx::Class::Optional::Dependencies->req_missing_for ('test_dt'),
+ DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_ase'),
+) )
+ unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_dt')
+ && DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_ase');
DBICTest::Schema->load_classes('EventSmallDT');