If you are creating a filesystem, say via Fuse or Filesys::Virtual, you need a fairly mundane set of tests to try out lots of typical filesystem operations. This package attempts to accumulate a bunch of those tests into a handy suite to make it easier for you to test your filesystem.

This suite is based on Test::Class, a fantastic library for organizing tests into bite-sized bundles. The power of Test::Class lets you select a subset of tests to run at author time. For example, when I was working on the extended attribute (aka xattr) tests, I found myself typing this:

env TEST_METHOD='xattr_.*' perl -Ilib t/filesys.t

which runs just the test methods that begin with xattr_.

There are several methods that let you turn on or off a subset of the tests. For example, if you do not intend that your filesystem will support symbolic links, you can invoke $test-enable_test_symlink(0)> in your test program just before you call $test-runtests>.

Every time I add a new test to this suite, I annotate it with a version number. If client code specifies an expected version number (say, 1.10) and it's running against a newer version or this module (say, 1.20) then any newer test will be marked as a TODO test. That way if the test fails, it won't regress published code that used to work.

This policy will allow us to continue adding new filesystem tests without worrying about breaking existing CPAN modules.

Specify a Test::Virtual::Filesystem version number that is known to work. If the actual Test::Virtual::Filesystem version number is greater, then any test cases added after the specified compatible version are considered TODO tests. See Test::More for details about TODO tests.

The following accessor/mutator methods exist to turn on/off various features. They all behave in usual Perl fashion: with no argument, they return the current value. With one argument, they set the current value and return the newly set value.

Look at the source code for %feature_defaults to see the supported features and subfeatures. The enable_test_* methods above describe the all the features, but in those methods the subfeature names are flattened.