Test modules which depend on your module
I want to run the test cases for Test::TCP dependent modules.
Yes, I know the Test::DependentModules. But I want more simpler version of the issue.
In this case, I don't want to run all dependent modules, because it's too many. I can't wait all modules done the tests. I want to run the test suites for some important modules, especially Plack.
Here is a small script to run the test suites for dependent modules.
use strict;
use warnings;
use Test::More 0.98;
BEGIN {
plan skip\_all => "AUTHOR\_TESTING is required." unless $ENV{AUTHOR\_TESTING};
}
use File::Which;
use File::Temp qw(tempdir);
plan skip\_all => "No cpanm" unless which('cpanm');
my $tmp = tempdir(CLEANUP => 1);
is(system("cpanm --notest -l $tmp ."), 0);
for (qw(Monoceros Plack)) {
is(system("cpanm -l $tmp --reinstall $\_"), 0, $\_);
}
done\_testing;
Published: 2013-05-29(Wed) 06:52