69236062bd7bbae717ad7616c236ac072f072723
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / 17sybase_asa_common.t
1 use strict;
2 use warnings;
3 use lib qw(t/lib);
4 use dbixcsl_common_tests;
5
6 # The default max_cursor_count and max_statement_count settings of 50 are too
7 # low to run this test.
8
9 my $dbd_sqlanywhere_dsn      = $ENV{DBICTEST_SYBASE_ASA_DSN} || '';
10 my $dbd_sqlanywhere_user     = $ENV{DBICTEST_SYBASE_ASA_USER} || '';
11 my $dbd_sqlanywhere_password = $ENV{DBICTEST_SYBASE_ASA_PASS} || '';
12
13 my $odbc_dsn      = $ENV{DBICTEST_SYBASE_ASA_ODBC_DSN} || '';
14 my $odbc_user     = $ENV{DBICTEST_SYBASE_ASA_ODBC_USER} || '';
15 my $odbc_password = $ENV{DBICTEST_SYBASE_ASA_ODBC_PASS} || '';
16
17 my $tester = dbixcsl_common_tests->new(
18     vendor      => 'SQLAnywhere',
19     auto_inc_pk => 'INTEGER IDENTITY NOT NULL PRIMARY KEY',
20     default_function => 'current timestamp',
21     connect_info => [ ($dbd_sqlanywhere_dsn ? {
22             dsn         => $dbd_sqlanywhere_dsn,
23             user        => $dbd_sqlanywhere_user,
24             password    => $dbd_sqlanywhere_password,
25         } : ()),
26         ($odbc_dsn ? {
27             dsn         => $odbc_dsn,
28             user        => $odbc_user,
29             password    => $odbc_password,
30         } : ()),
31     ],
32 );
33
34 if (not ($dbd_sqlanywhere_dsn || $odbc_dsn)) {
35     $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');
36 }
37 else {
38     $tester->run_tests();
39 }