I want to add a test to my Perl distribution that requires a module Foo, but my distribution does not require Foo; only the test requires Foo. So I don't want to add the module to the dependencies, but instead I just want to skip the tests that require Foo if Foo is not available at build time.
What is the proper way to do this? Should I just wrap my Foo tests in an eval block along with use Foo;
, so that the tests will not run if loading Foo fails? Or is there a more elegant way of doing it?