This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Tie::File: use unique tmp filenames in test files
authorDavid Mitchell <davem@iabyn.com>
Mon, 13 Jan 2020 14:04:38 +0000 (14:04 +0000)
committerDavid Mitchell <davem@iabyn.com>
Mon, 13 Jan 2020 14:04:38 +0000 (14:04 +0000)
commit0a1552badab72b9ca7cbf463b95d172aa90d8fe6
tree6e71782b97055ecffec543640f6ec032c5ecbda6
parentaaa9d2b46fba28ce6105ebb90809dd7da998e6d9
Tie::File: use unique tmp filenames in test files

Currently all the test scripts use a temporary file of the form
"tf$$.txt", which could possibly cause clashes between test scripts
on platforms where the PID cycles frequently. This commit gives each
test file its own unique tmp-filename prefix, e.g. 42_offset.t now has

    my $file = "tf42-$$.txt";

I probably should have switched over completely to using File::Temp,
but this was a smaller change, and I haven't tested it on older perls.

The motivation for this is occasional test failures of 29a_upcopy.t on
some smokes. Whether this commit fixes that, only time will tell.
35 files changed:
dist/Tie-File/t/01_gen.t
dist/Tie-File/t/02_fetchsize.t
dist/Tie-File/t/03_longfetch.t
dist/Tie-File/t/04_splice.t
dist/Tie-File/t/05_size.t
dist/Tie-File/t/06_fixrec.t
dist/Tie-File/t/07_rv_splice.t
dist/Tie-File/t/08_ro.t
dist/Tie-File/t/09_gen_rs.t
dist/Tie-File/t/10_splice_rs.t
dist/Tie-File/t/11_rv_splice_rs.t
dist/Tie-File/t/12_longfetch_rs.t
dist/Tie-File/t/13_size_rs.t
dist/Tie-File/t/14_lock.t
dist/Tie-File/t/15_pushpop.t
dist/Tie-File/t/16_handle.t
dist/Tie-File/t/17_misc_meth.t
dist/Tie-File/t/18_rs_fixrec.t
dist/Tie-File/t/19_cache.t
dist/Tie-File/t/20_cache_full.t
dist/Tie-File/t/21_win32.t
dist/Tie-File/t/22_autochomp.t
dist/Tie-File/t/23_rv_ac_splice.t
dist/Tie-File/t/24_cache_loop.t
dist/Tie-File/t/25_gen_nocache.t
dist/Tie-File/t/26_twrite.t
dist/Tie-File/t/27_iwrite.t
dist/Tie-File/t/28_mtwrite.t
dist/Tie-File/t/29_downcopy.t
dist/Tie-File/t/29a_upcopy.t
dist/Tie-File/t/30_defer.t
dist/Tie-File/t/31_autodefer.t
dist/Tie-File/t/32_defer_misc.t
dist/Tie-File/t/33_defer_vs.t
dist/Tie-File/t/42_offset.t