diff --git a/t/01logon.t b/t/01logon.t index 42b5011..f32e13a 100644 --- a/t/01logon.t +++ b/t/01logon.t @@ -13,3 +13,4 @@ ok($dbh->func('busy_timeout'), 5000); print "# sqlite_busy_timeout=", $dbh->func('busy_timeout'), "\n"; $dbh->disconnect; +END { unlink 'foo' } diff --git a/t/02cr_table.t b/t/02cr_table.t index 5640761..e1d0d53 100644 --- a/t/02cr_table.t +++ b/t/02cr_table.t @@ -3,7 +3,6 @@ use strict; use Test; BEGIN { plan tests => 4 } use DBI; -unlink("foo"); my $dbh = DBI->connect("dbi:SQLite:dbname=foo", "", ""); ok($dbh); $dbh->{AutoCommit} = 1; @@ -16,3 +15,5 @@ print("# ", join(', ', @$names), "\n"); ok($names->[0] eq "f1"); # make sure the "f." is removed undef $sth; $dbh->disconnect; + +END { unlink 'foo' } diff --git a/t/03insert.t b/t/03insert.t index 160d1a8..a5d3460 100644 --- a/t/03insert.t +++ b/t/03insert.t @@ -24,3 +24,5 @@ ok($dbh->do("delete from f where f1='test'"), 3); $sth->finish; undef $sth; $dbh->disconnect; + +END { unlink 'foo' } diff --git a/t/04select.t b/t/04select.t index a7427bc..f95afb8 100644 --- a/t/04select.t +++ b/t/04select.t @@ -53,3 +53,5 @@ $sth->finish; undef $sth; $dbh->do("delete from f where f1='test'"); $dbh->disconnect; + +END { unlink 'foo' } diff --git a/t/05tran.t b/t/05tran.t index 27f717f..a1f590e 100644 --- a/t/05tran.t +++ b/t/05tran.t @@ -36,3 +36,5 @@ while(my $raD = $sth->fetchrow_arrayref()) { } undef $sth; $dbh->disconnect; + +END { unlink 'foo' } diff --git a/t/06error.t b/t/06error.t index b188cc6..02257e3 100644 --- a/t/06error.t +++ b/t/06error.t @@ -19,3 +19,5 @@ eval { $db->do('insert into testerror values (1, 5)'); }; ok($@); + +END { unlink 'foo' } diff --git a/t/07busy.t b/t/07busy.t index 2a23f41..df781e3 100644 --- a/t/07busy.t +++ b/t/07busy.t @@ -5,7 +5,6 @@ use Test; BEGIN { plan tests => 8 } use DBI; -unlink('foo', 'foo-journal'); my $db = DBI->connect('dbi:SQLite:foo', '', '', { RaiseError => 1, @@ -74,3 +73,5 @@ if (!defined($pid)) { $db->commit; wait; } + +END { unlink('foo', 'foo-journal') } diff --git a/t/08create_function.t b/t/08create_function.t index b9c7945..e2e443b 100644 --- a/t/08create_function.t +++ b/t/08create_function.t @@ -120,3 +120,5 @@ $result = $dbh->selectrow_arrayref( "SELECT noop(1.0625)" ); is_deeply( $result, [ 1.0625 ], "SELECT noop(1.0625)" ); $dbh->disconnect; + +END { unlink 'foo' } diff --git a/t/09create_aggregate.t b/t/09create_aggregate.t index 96f2d19..8d030fb 100644 --- a/t/09create_aggregate.t +++ b/t/09create_aggregate.t @@ -127,3 +127,5 @@ $dbh->func( "fail_undef", -1, $aggr, 'create_aggregate' ); $result = $dbh->selectrow_arrayref( "SELECT fail_undef() FROM aggr_test" ); # ok( !$result && $DBI::errstr =~ /new\(\) should return a blessed reference/ ); ok( !defined $result->[0] && $last_warn =~ /new\(\) should return a blessed reference/ ); + +END { unlink 'foo' } diff --git a/t/10dsnlist.t b/t/10dsnlist.t index 36ffe0e..8b8f36f 100644 --- a/t/10dsnlist.t +++ b/t/10dsnlist.t @@ -81,3 +81,5 @@ exit 0; # Hate -w :-) $test_dsn = $test_user = $test_password = $DBI::errstr; + +END { unlink 'output/foo'; rmdir 'output' } diff --git a/t/11unicode.t b/t/11unicode.t index 3fb01cb..579a20f 100644 --- a/t/11unicode.t +++ b/t/11unicode.t @@ -133,4 +133,6 @@ Test($lengths->[0]->[0] == $lengths->[0]->[1], "Database actually understands char set") or warn "($lengths->[0]->[0] != $lengths->[0]->[1])"; -END { $dbh->do("DROP TABLE $table"); } +END { $dbh->do("DROP TABLE $table"); $dbh->disconnect; } + +END { unlink 'output/foo'; rmdir 'output' } diff --git a/t/12create_collation.t b/t/12create_collation.t index f343e6a..432dece 100644 --- a/t/12create_collation.t +++ b/t/12create_collation.t @@ -96,3 +96,5 @@ is_deeply(\@sorted, $db_sorted, "collate no_accents (@sorted // @$db_sorted)"); $dbh->disconnect; + +END { unlink 'foo' } diff --git a/t/13progress_handler.t b/t/13progress_handler.t index ff46feb..f0c764a 100644 --- a/t/13progress_handler.t +++ b/t/13progress_handler.t @@ -42,3 +42,5 @@ $result = $dbh->do( "SELECT * from progress_test ORDER BY foo DESC " ); ok(!$n_callback); $dbh->disconnect; + +END { unlink 'foo' } diff --git a/t/20createdrop.t b/t/20createdrop.t index 30543ed..5c8a6f8 100644 --- a/t/20createdrop.t +++ b/t/20createdrop.t @@ -80,3 +80,5 @@ while (Testing()) { Test($state or $dbh->disconnect()) or DbiError($dbh->err, $dbh->errstr); } + +END { unlink 'output/foo'; rmdir 'output' } diff --git a/t/30insertfetch.t b/t/30insertfetch.t index 160577b..766df07 100644 --- a/t/30insertfetch.t +++ b/t/30insertfetch.t @@ -148,3 +148,4 @@ while (Testing()) { } +END { unlink 'output/foo'; rmdir 'output' } diff --git a/t/40bindparam.t b/t/40bindparam.t index 8ff7553..4452fea 100644 --- a/t/40bindparam.t +++ b/t/40bindparam.t @@ -198,3 +198,5 @@ while (Testing()) { Test($state or $dbh->do("DROP TABLE $table")) or DbiError($dbh->err, $dbh->errstr); } + +END { unlink 'output/foo'; rmdir 'output' } diff --git a/t/40blobs.t b/t/40blobs.t index 98b614d..ac72a4c 100644 --- a/t/40blobs.t +++ b/t/40blobs.t @@ -175,3 +175,5 @@ while (Testing()) { or DbiError($dbh->err, $dbh->errstr); } } + +END { unlink 'output/foo'; rmdir 'output' } diff --git a/t/40blobtext.t b/t/40blobtext.t index c398ec7..a300ead 100644 --- a/t/40blobtext.t +++ b/t/40blobtext.t @@ -62,7 +62,7 @@ undef $sel; $db->disconnect; -unlink('foo', 'foo-journal'); +END { unlink('foo', 'foo-journal'); } sub dumpblob { @@ -85,3 +85,4 @@ sub dumpblob { } if ($ENV{SHOW_BLOBS}) { close(OUT) } } + diff --git a/t/40listfields.t b/t/40listfields.t index 353a4aa..0c66d09 100644 --- a/t/40listfields.t +++ b/t/40listfields.t @@ -128,3 +128,5 @@ while (Testing()) { $cursor->{'NUM_OF_FIELDS'}); Test($state or (undef $cursor) or 1); } + +END { unlink 'output/foo'; rmdir 'output' } diff --git a/t/40nulls.t b/t/40nulls.t index bada335..2004db9 100644 --- a/t/40nulls.t +++ b/t/40nulls.t @@ -105,3 +105,5 @@ while (Testing()) { or DbiError($dbh->err, $dbh->errstr); } + +END { unlink 'output/foo'; rmdir 'output' } diff --git a/t/40numrows.t b/t/40numrows.t index ae3e45e..d2ec60b 100644 --- a/t/40numrows.t +++ b/t/40numrows.t @@ -154,3 +154,5 @@ while (Testing()) { or DbiError($dbh->err, $dbh->errstr); } + +END { unlink 'output/foo'; rmdir 'output' } diff --git a/t/40prepcached.t b/t/40prepcached.t index 1f34a15..a25738c 100644 --- a/t/40prepcached.t +++ b/t/40prepcached.t @@ -133,3 +133,5 @@ while (Testing()) { or DbiError($dbh->err, $dbh->errstr); } + +END { unlink 'output/foo'; rmdir 'output' } diff --git a/t/50chopblanks.t b/t/50chopblanks.t index d577ee6..baee9a4 100644 --- a/t/50chopblanks.t +++ b/t/50chopblanks.t @@ -146,5 +146,4 @@ while (Testing()) { or ErrMsgF("Cannot disconnect: %s.\n", $dbh->errmsg); } - - +END { unlink 'output/foo'; rmdir 'output' } diff --git a/t/50commit.t b/t/50commit.t index 21f9dbf..8d3aea5 100644 --- a/t/50commit.t +++ b/t/50commit.t @@ -222,3 +222,5 @@ while (Testing()) { or ErrMsgF("Cannot DROP test table $table: %s.\n", $dbh->errstr); } + +END { unlink 'output/foo'; rmdir 'output' } diff --git a/t/60metadata.t b/t/60metadata.t index f20bb13..1d3fc4b 100644 --- a/t/60metadata.t +++ b/t/60metadata.t @@ -51,3 +51,5 @@ ok($types->[1] eq 'char(1)'); ok $dbh->do("create table meta5 ( f1 integer PRIMARY KEY )"); @pk = $dbh->primary_key(undef, undef, 'meta5'); ok($pk[0] eq 'f1'); + +END { unlink 'foo' } diff --git a/t/70schemachange.t b/t/70schemachange.t index 6936408..ab0ea36 100644 --- a/t/70schemachange.t +++ b/t/70schemachange.t @@ -94,3 +94,5 @@ while (Testing()) { Test($state or $dbh->disconnect()) or DbiError($dbh->err, $dbh->errstr); } + +END { unlink 'output/foo'; rmdir 'output' } diff --git a/t/ak-dbd.t b/t/ak-dbd.t index 7d095c2..18a9a7a 100644 --- a/t/ak-dbd.t +++ b/t/ak-dbd.t @@ -354,3 +354,5 @@ while (Testing()) { or ErrMsg("disconnect failed: $dbh->errstr.\n"); } } + +END { unlink 'output/foo'; rmdir 'output' }