Testing Moose and Mouse for Any::Moose
Or Re: RT #58255
If you use Module::Install, Module::Install::TestTarget will help you.
In your Makefile.PL:
use inc::Module::Install; ...; test_target test_moose => ( env => { ANY_MOOSE => 'Moose' }, alias_for_author => 'test', ); ...;
The test_target() function defines a new make target "test_moose" (i.e. you can `make test_moose` in the above case) with the environment variable "ANY_MOOSE=Moose", and that target is aliased (or attached) to `make test` if and only if you run it as the author's mode. In that setting all you have to do in testing is to type `make test`, which also triggers `make test_moose`.
See also the Text::Xslate distribution for an actual use case.
Enjoy!