When testing, check if '/proc/mounts' exists.
authorBojan Petrovic <bojan_petrovic@fastmail.fm>
Sat, 21 May 2011 08:47:50 +0000 (10:47 +0200)
committerBojan Petrovic <bojan_petrovic@fastmail.fm>
Sat, 21 May 2011 08:57:15 +0000 (10:57 +0200)
On FreeBSD, even if procfs is mounted under '/proc', there is no
'/proc/mounts' file.  Instead on relying on the existence of '/proc'
directory, we check if the '/proc/mounts' file exists. Otherwise, tests
cannot even start on FreeBSD.

test/s/mount.t

index c8bc61d..2381734 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use Test::More tests => 3;
 
 sub is_mounted {
-       my $diag = -d '/proc' ? `cat /proc/mounts` : `mount`;
+       my $diag = -e '/proc/mounts' ? `cat /proc/mounts` : `mount`;
        return $diag =~ m{ (?:/private)?$_point };
 }