From: Rafael Kitover Date: Tue, 9 Mar 2010 23:03:52 +0000 (-0500) Subject: merge t/17sybase_asa_common.t and t/17sybase_asa_odbc_common.t X-Git-Tag: 0.06000~54 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5347f50139d7280c04bb48e2d693ef0909165328;p=dbsrgits%2FDBIx-Class-Schema-Loader.git merge t/17sybase_asa_common.t and t/17sybase_asa_odbc_common.t --- diff --git a/t/17sybase_asa_common.t b/t/17sybase_asa_common.t index 625c044..6923606 100644 --- a/t/17sybase_asa_common.t +++ b/t/17sybase_asa_common.t @@ -1,25 +1,38 @@ use strict; +use warnings; use lib qw(t/lib); use dbixcsl_common_tests; # The default max_cursor_count and max_statement_count settings of 50 are too # low to run this test. -my $dsn = $ENV{DBICTEST_SYBASE_ASA_DSN} || ''; -my $user = $ENV{DBICTEST_SYBASE_ASA_USER} || ''; -my $password = $ENV{DBICTEST_SYBASE_ASA_PASS} || ''; +my $dbd_sqlanywhere_dsn = $ENV{DBICTEST_SYBASE_ASA_DSN} || ''; +my $dbd_sqlanywhere_user = $ENV{DBICTEST_SYBASE_ASA_USER} || ''; +my $dbd_sqlanywhere_password = $ENV{DBICTEST_SYBASE_ASA_PASS} || ''; + +my $odbc_dsn = $ENV{DBICTEST_SYBASE_ASA_ODBC_DSN} || ''; +my $odbc_user = $ENV{DBICTEST_SYBASE_ASA_ODBC_USER} || ''; +my $odbc_password = $ENV{DBICTEST_SYBASE_ASA_ODBC_PASS} || ''; my $tester = dbixcsl_common_tests->new( vendor => 'SQLAnywhere', auto_inc_pk => 'INTEGER IDENTITY NOT NULL PRIMARY KEY', default_function => 'current timestamp', - dsn => $dsn, - user => $user, - password => $password, + 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, + } : ()), + ], ); -if( !$dsn ) { - $tester->skip_tests('You need to set the DBICTEST_SYBASE_ASA_DSN, _USER, and _PASS environment variables'); +if (not ($dbd_sqlanywhere_dsn || $odbc_dsn)) { + $tester->skip_tests('You need to set the DBICTEST_SYBASE_ASA_DSN, _USER and _PASS and/or the DBICTEST_SYBASE_ASA_ODBC_DSN, _USER and _PASS environment variables'); } else { $tester->run_tests(); diff --git a/t/17sybase_asa_odbc_common.t b/t/17sybase_asa_odbc_common.t deleted file mode 100644 index 1b42199..0000000 --- a/t/17sybase_asa_odbc_common.t +++ /dev/null @@ -1,26 +0,0 @@ -use strict; -use lib qw(t/lib); -use dbixcsl_common_tests; - -# The default max_cursor_count and max_statement_count settings of 50 are too -# low to run this test. - -my $dsn = $ENV{DBICTEST_SYBASE_ASA_ODBC_DSN} || ''; -my $user = $ENV{DBICTEST_SYBASE_ASA_ODBC_USER} || ''; -my $password = $ENV{DBICTEST_SYBASE_ASA_ODBC_PASS} || ''; - -my $tester = dbixcsl_common_tests->new( - vendor => 'SQLAnywhere', - auto_inc_pk => 'INTEGER IDENTITY NOT NULL PRIMARY KEY', - default_function => 'current timestamp', - dsn => $dsn, - user => $user, - password => $password, -); - -if( !$dsn ) { - $tester->skip_tests('You need to set the DBICTEST_SYBASE_ASA_DSN, _USER, and _PASS environment variables'); -} -else { - $tester->run_tests(); -}