This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Handle OSes where filesystems can be mounted with 'noatime' option
authorJames E Keenan <jkeenan@cpan.org>
Wed, 31 Oct 2018 23:03:19 +0000 (19:03 -0400)
committerJames E Keenan <jkeenan@cpan.org>
Wed, 31 Oct 2018 23:07:32 +0000 (19:07 -0400)
Adapted from http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/lang/perl5/patches/patch-ta?rev=1.6&content-type=text/x-cvsweb-markup

For readability, change a 'skip' whose block lacked tests to be skipped
with a simple 'pass'.

For RT 132663

t/io/fs.t

index ecab714..90bcc31 100644 (file)
--- a/t/io/fs.t
+++ b/t/io/fs.t
@@ -498,6 +498,9 @@ sub check_utime_result {
             pass('mtime: granularity test');
         }
         else {
+            # Operating systems whose filesystems may be mounted with the noatime option
+            # RT 132663
+            my %noatime_oses = map { $_ => 1 } ( qw| haiku netbsd | );
             if ($^O =~ /\blinux\b/i) {
                 note("# Maybe stat() cannot get the correct atime, ".
                     "as happens via NFS on linux?");
@@ -518,10 +521,8 @@ sub check_utime_result {
                 is( $atime, $ut + 1,      'atime: VMS' );
                 is( $mtime, $ut + $delta, 'mtime: VMS' );
             }
-            elsif ($^O eq 'haiku') {
-                SKIP: {
-                    skip "atime not updated", 1;
-                }
+            elsif ($noatime_oses{$^O}) {
+                pass("atime not updated");
                 is($mtime, 500000001, 'mtime');
             }
             else {