File: 00versions.t

package info (click to toggle)
libdbd-oracle-perl 1.74-3
  • links: PTS, VCS
  • area: contrib
  • in suites: stretch
  • size: 1,808 kB
  • ctags: 653
  • sloc: ansic: 8,165; perl: 6,942; makefile: 18
file content (45 lines) | stat: -rw-r--r-- 1,044 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# reports on all interesting versions

use strict;
use warnings;

use lib 't';

use Test::More tests => 2;

use DBD::Oracle qw/ ORA_OCI /;
require 'nchar_test_lib.pl';

my $oci_version = ORA_OCI();

diag "OCI client library version: ", $oci_version;

ok $oci_version;

SKIP: {
    my $dsn = oracle_test_dsn();
    my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
    
    my $dbh = DBI->connect($dsn, $dbuser, '',{ PrintError => 0, }) or 
        note <<'END_NOTE' or skip q{can't connect to database} => 1;

Can't connect to an Oracle instance. 

Without a database connection, most of DBD::Oracle's test suite will
be skipped. To let the tests use a database, set up the 
environment variables ORACLE_USERID and ORACLE_DSN. E.g.:

    $ export ORACLE_USERID='scott/tiger'
    $ export ORACLE_DSN='dbi:Oracle:testdb'

END_NOTE

    my $sth = $dbh->prepare( q{select * from v$version where banner like 'Oracle%'} );
    $sth->execute;

    my $version = join ' ', $sth->fetchrow;

    diag 'database version: ', $version;

    ok $version;
}