1 package dbixcsl_test_dir;
5 use File::Path 'rmtree';
6 use Scalar::Util 'weaken';
12 use base qw/Exporter/;
13 our @EXPORT_OK = '$tdir';
15 die "/t does not exist, this can't be right...\n"
19 mkdir $tdir or die "Unable to create $tdir: $!\n";
22 # We need to disconnect all active DBI handles before deleting the directory,
23 # otherwise the SQLite .db files cannot be deleted on Win32 (file in use) since
24 # END does not run in any sort of order.
26 no warnings 'redefine';
28 my $connect = \&DBI::connect;
33 my $dbh = $connect->(@_);
40 if (not $ENV{SCHEMA_LOADER_TESTS_NOCLEANUP}) {
41 foreach my $dbh (@handles) {
42 $dbh->disconnect if $dbh;