/[fuse.before_github]/branches/xattr/test/helper.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /branches/xattr/test/helper.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 114 - (show annotations)
Thu Dec 6 10:52:28 2007 UTC (16 years, 6 months ago) by dpavlin
File size: 902 byte(s)
make OS X xattr branch
1 #!/usr/bin/perl
2 package test::helper;
3 use strict;
4 use Exporter;
5 use Config;
6 use POSIX qw(WEXITSTATUS);
7 our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
8 @ISA = "Exporter";
9 @EXPORT_OK = qw($_loop $_point $_pidfile $_real);
10 my $tmp = -d '/private' ? '/private/tmp' : '/tmp';
11 our($_loop, $_point, $_pidfile, $_real) = ("","$tmp/fusemnt-".$ENV{LOGNAME},"test/s/mounted.pid","$tmp/fusetest-".$ENV{LOGNAME});
12 $_loop = $^O ne 'darwin' && $Config{useithreads} ? "examples/loopback_t.pl" : "examples/loopback.pl";
13 if($0 !~ qr|s/u?mount\.t$|) {
14 my ($reject) = 1;
15 if(open my $fh, '<', $_pidfile) {
16 my $pid = do {local $/ = undef; <$fh>};
17 close $fh;
18 if(kill 0, $pid) {
19 if(`mount` =~ m{on (?:/private)?$_point }) {
20 $reject = 0;
21 } else {
22 kill 1, $pid;
23 }
24 }
25 }
26 system("ls $_point >/dev/null");
27 $reject = 1 if (POSIX::WEXITSTATUS($?));
28 die "not properly mounted\n" if $reject;
29 }
30 1;

  ViewVC Help
Powered by ViewVC 1.1.26