On 07/31/2009 01:51 PM, Jonathan Swartz wrote:
There are certain tests in my distribution that I don't want end users
to run. I want to run them during development, and I also want anyone
else contributing to the distribution to run them. These are typically related to static analysis of the code, e.g. perl critic, perl tidy and pod checking - it makes no sense to risk having these fail for end users.

Is there a standard for signifying internal-only tests, and for make
test to figure out when they should run?

Good question. I use TEST_AUTHOR for things like this, plus a few other specific ones, such as TEST_CRITIC, for tests that end users *can* run,
but only if they specifically enable it.

To figure out if they should run in a test, I do:

use Test::More;

if (!$ENV{TEST_AUTHOR}) {
plan skip_all => 'Set the environment variable TEST_AUTHOR to enable
this test';
}
plan tests => 1;

I've also started moving the tests themselves from MANIFEST to MANIFEST.skip

Wow, putting them in MANIFEST.skip - what a simple and great idea. :) I don't even need the environment variable in that case. Anyone who is running 'make test' in the git source will see the internal tests, as they should...anyone who has the published distribution won't see them.

Thanks!

Jon

Reply via email to