Thanks John,
Good idea, have implemented it as a dbh read-only attribute.
Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
John Scoles wrote:
You might want to add a property to the package DBD::ODBC::db called
can_unicode
set it during the Make process then read it in the test process??
We have a method like that in DBD::ORACLE
here is the stub (of course you know to change the ora_ )
sub ora_can_unicode {
my $dbh = shift;
my $refresh = shift;
# 0 = No Unicode support.
# 1 = National character set is Unicode-based.
# 2 = Database character set is Unicode-based.
# 3 = Both character sets are Unicode-based.
return $dbh->{ora_can_unicode}
if defined $dbh->{ora_can_unicode} && !$refresh;
my $nls = $dbh->ora_nls_parameters($refresh);
$dbh->{ora_can_unicode} = 0;
$dbh->{ora_can_unicode} += 1 if $nls->{NLS_NCHAR_CHARACTERSET} =~ /UTF/;
$dbh->{ora_can_unicode} += 2 if $nls->{NLS_CHARACTERSET} =~ /UTF/;
return $dbh->{ora_can_unicode};
}
----- Original Message ----- From: "Martin Evans"
<[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, July 03, 2007 12:13 PM
Subject: DBD test case conditional on compile option
Hi,
I am modifying DBD::ODBC and a switch to perl Makefile.PL will cause
DBD::ODBC to be built with a different compile macro (e.g.
-DWITH_UNICODE). The problem is that some of the test cases are only
relevant if DBD::ODBC is compiled with this option.
Originally, I was going to modify Makefile.PL to create a file called
WITH_UNICODE and check for its existence in the test and skip the
tests if not found. However, I don't know how to remove the file in
the make clean rule of MakeMaker.
Any ideas how I can do this, or alternatives greatly appreciated.
Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com