Skip to content

Commit

Permalink
in embedded mode create test database in local directory
Browse files Browse the repository at this point in the history
this way we can remove the test database at clean time
  • Loading branch information
real-dam committed Sep 20, 2011
1 parent 9c03cfb commit a566148
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile.PL
Expand Up @@ -166,7 +166,7 @@ my %MakeParams = (
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz' },
clean => {
FILES =>
qq(*.xsi *.old t/*.old *~ t/*~ trace.txt t/trace.txt lib/DBD/Firebird/*~ lib/DBD/Firebird/*.old lib/Bundle/DBD/*~ lib/Bundle/DBD/*.old dll.* fb_init fb_trace_*)
qq(*.xsi *.old t/*.old *~ t/*~ trace.txt t/trace.txt lib/DBD/Firebird/*~ lib/DBD/Firebird/*.old lib/Bundle/DBD/*~ lib/Bundle/DBD/*.old dll.* fb_init fb_trace_* dbd-fb-testdb.fdb)
},
realclean => { FILES => qq($test_conf $test_mark t/*.sql) },
AUTHOR => 'Edwin Pratomo (edpratomo@users.sourceforge.net)',
Expand Down
12 changes: 10 additions & 2 deletions t/tests-setup.pl
Expand Up @@ -191,9 +191,17 @@ sub get_dsn {

my $param = shift;

my $path = File::Spec->catfile(File::Spec->tmpdir(), 'dbd-fb-testdb.fdb');
my $path;

$path = "localhost:$path" unless $param->{use_libfbembed};
if ( $param->{use_libfbembed} ) {
$path = "dbd-fb-testdb.fdb";
}
else {
$path
= 'localhost:'
. File::Spec->catfile( File::Spec->tmpdir(),
'dbd-fb-testdb.fdb' );
}

return "dbi:Firebird:db=$path;ib_dialect=3;ib_charset=ISO8859_1";
}
Expand Down

0 comments on commit a566148

Please sign in to comment.