Port taint-related fixes from b5ce6748, 4fb8d74c and 652d9b76
[dbsrgits/DBIx-Class.git] / t / storage / debug.t
index 632f370..5a43024 100644 (file)
@@ -10,11 +10,14 @@ use DBIC::DebugObj;
 use DBIC::SqlMakerTest;
 use Path::Class qw/file/;
 
+plan skip_all => "Test is finicky under -T before 5.10"
+  if "$]" < 5.010 and ${^TAINT};
+
 BEGIN { delete @ENV{qw(DBIC_TRACE DBIC_TRACE_PROFILE DBICTEST_SQLITE_USE_FILE)} }
 
 my $schema = DBICTest->init_schema();
 
-my $lfn = file('t/var/sql.log');
+my $lfn = file("t/var/sql-$$.log");
 unlink $lfn or die $!
   if -e $lfn;
 
@@ -49,6 +52,10 @@ $schema->storage->debugfh(undef);
   $schema->storage->debugobj->debugfh(undef)
 }
 
+END {
+  unlink $lfn if $lfn;
+}
+
 open(STDERRCOPY, '>&STDERR');
 close(STDERR);
 dies_ok {