Elliot Shank wrote:
David Cantrell wrote:
On Fri, Jul 31, 2009 at 10:51:57AM -0700, Jonathan Swartz wrote:
Is there a standard for signifying internal-only tests, and for make test to figure out when they should run?

The normal way is to have them skip unless some magic environment
variable is set.

Perl::Critic used to do this and then we'd get bug reports from people who used the same environment variables to run their author tests.

To get around this problem, what I sometime do is to use the environment TEST_AUTHOR, but instead of just setting it to a true value, I set it to the list of modules I own. E.g.,

   $ export TEST_AUTHOR = "Test::Pod::Snippet,Git::CPAN::Patch"

and then when I check for TEST_AUTHOR, I check specifically for the current module:


   $ENV{ TEST_AUTHOR } =~ /Pod::Manual/
        or plan skip_all,
           q{Set TEST_AUTHOR to 'Pod::Manual' in your environment }
         . q{ to enable these tests};


(of course, I should rather use "any { $_ eq 'Pod::Manual } split ',', $ENV{TEST_AUTHOR}" in case someone ever release Pod::Manual::Foo, but you get the idea)


Joy,
`/anick

Reply via email to