/[fuse.before_github]/perl/trunk/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

Annotation of /perl/trunk/test/helper.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 19 - (hide annotations)
Tue Dec 27 12:47:00 2005 UTC (16 years, 6 months ago) by dpavlin
File size: 847 byte(s)
Changes from Mark Glines in preparation for 0.07
- Remove the FUSE_DEBUG constant; we never actually implemented
  it to begin with.
- "make test" now uses the version of Fuse you've just built,
  not the one installed in /usr/lib/perl5.
- getattr test now allows blksize to vary between host and fuse
  fs, as this is not a bug.
- Add experimental support for threading.  The following minor
  API changes accommodate this:
- The nonexistent (yet documented) "unthreaded=>1" attribute
  has been replaced with the "threaded=>1" attribute, and this
  time it actually exists.
- Symbolic refs like "main::e_getattr" are now allowed for
  callbacks, because threaded mode needs to share() the
  callbacks, yet perl 5.8.7 does not allow share()ing code
  refs yet.  Direct code-refs are still supported as much
  as possible (currently, non-threaded mode).
- testsuite uses a multithreaded loopback.pl, when available.
- Update docs accordingly.  Update examples accordingly.

1 mszeredi 4 #!/usr/bin/perl
2     package test::helper;
3     use strict;
4     use Exporter;
5 dpavlin 19 use Config;
6 dpavlin 10 use POSIX qw(WEXITSTATUS);
7 mszeredi 4 our ($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
8     @ISA = "Exporter";
9     @EXPORT_OK = qw($_loop $_point $_pidfile $_real);
10 dpavlin 19 our($_loop, $_point, $_pidfile, $_real) = ("","/tmp/fusemnt-".$ENV{LOGNAME},"test/s/mounted.pid","/tmp/fusetest-".$ENV{LOGNAME});
11     $_loop = $Config{useithreads} ? "examples/loopback_t.pl" : "examples/loopback.pl";
12 mszeredi 4 if($0 !~ qr|s/u?mount\.t$|) {
13     my ($reject) = 1;
14     if(-f $_pidfile) {
15 dpavlin 10 unless(POSIX::WEXITSTATUS(system("ps `cat $_pidfile` | grep \"$_loop $_point\" >/dev/null"))) {
16 mszeredi 4 if(`mount | grep "on $_point"`) {
17     $reject = 0;
18     } else {
19     system("kill `cat $_pidfile`");
20     }
21     }
22     }
23 dpavlin 10 system("ls $_point >&/dev/null");
24     $reject = 1 if (POSIX::WEXITSTATUS($?));
25 mszeredi 4 die "not properly mounted\n" if $reject;
26     }
27     1;

  ViewVC Help
Powered by ViewVC 1.1.26