1 package # Hide from PAUSE
5 use warnings FATAL => 'all';
14 use File::Temp qw( tempfile tempdir );
15 use Fcntl qw( :flock );
17 my $parent = $ENV{WORK_DIR} || File::Spec->tmpdir;
18 my $dir = tempdir( CLEANUP => 1, DIR => $parent );
21 my ($fh, $filename) = tempfile( 'tmpXXXX', DIR => $dir, UNLINK => 1 );
23 # This is because tempfile() returns a flock'ed $fh on MacOSX.
26 return ($fh, $filename);
31 my ($fh, $filename) = new_fh();
33 [ file => $filename ],
36 # eval { require DBD::SQLite; };
42 if ( $ENV{TEST_MYSQL_DSN} ) {
45 dsn => "dbi:mysql:$ENV{TEST_MYSQL_DSN}",
46 user => $ENV{TEST_MYSQL_USER},
47 password => $ENV{TEST_MYSQL_PASS},
53 return unless @extra_args;
54 my @these_args = @{ shift @extra_args };
57 @these_args, @args, @_,