X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2Fsyslfs.t;h=2bdb69d7e01ce9cd4291a68951a04f66de6d1fdd;hb=569bd3158af2276a406770e3d68e76b7da59b730;hp=181a147f51fcba9a824b7d990c1ee02ea8c9c83f;hpb=ea2b5ef6d751420797c96208ee3824f54bf1d97a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/lib/syslfs.t b/t/lib/syslfs.t index 181a147..2bdb69d 100644 --- a/t/lib/syslfs.t +++ b/t/lib/syslfs.t @@ -1,106 +1,265 @@ # NOTE: this file tests how large files (>2GB) work with raw system IO. -# open(), tell(), seek(), print(), read() are tested in t/op/lfs.t. +# stdio: open(), tell(), seek(), print(), read() is tested in t/op/lfs.t. # If you modify/add tests here, remember to update also t/op/lfs.t. BEGIN { - eval { my $q = pack "q", 0 }; - if ($@) { - print "1..0\n# no 64-bit types\n"; - bye(); - } chdir 't' if -d 't'; - unshift @INC, '../lib'; - require Fcntl; import Fcntl; + @INC = '../lib'; + require Config; import Config; + # Don't bother if there are no quad offsets. + if ($Config{lseeksize} < 8) { + print "1..0 # Skip: no 64-bit file offsets\n"; + exit(0); + } + require Fcntl; import Fcntl qw(/^O_/ /^SEEK_/); } -sub bye { +use strict; + +our @s; +our $fail; + +sub zap { close(BIG); - unlink "big"; + unlink("big"); + unlink("big1"); + unlink("big2"); +} + +sub bye { + zap(); exit(0); } -# First try to figure out whether we have sparse files. +my $explained; -if ($^O eq 'win32' || $^O eq 'vms') { - print "1..0\n# no sparse files\n"; +sub explain { + unless ($explained++) { + print <