Move tmpdir() to DBICTest::Util where it belongs
This detangles things even more. Add some extra logic fixes to the hideous
routine while we are at it...
Some notes on the actual test pefrormed: there have been cases on smokers
where a returned directory was not in fact writable [1]. Thus work harder
making sure everything works. The check is expensive but not terribly so:
about 14ms on cold caches ( echo 3 > /proc/sys/vm/drop_caches ) and ~6ms
thereafter. This adds up to 2 seconds over the current 320 tests. Timed via:
~$ perl -It/lib -Ilib -MANFANG -MDBICTest::Util=tmpdir -MTime::HiRes=time -e '
my $t0 = time;
sub delta_t { my $t = time; printf "%.06f\n", $t - $t0; $t0 = $t }
delta_t();
print tmpdir . "\n";
delta_t();
print tmpdir . "\n";
delta_t();
print tmpdir . "\n";
delta_t();
'
[1] http://www.cpantesters.org/cpan/report/
36d4436d-7888-1014-a278-e5322b825c07