Skip to content

Commit

Permalink
Reshuffle Makefile.PL a bit and add parallel-testing exception
Browse files Browse the repository at this point in the history
  • Loading branch information
ribasushi committed Jul 17, 2011
1 parent 17877ef commit bb7950c
Showing 1 changed file with 38 additions and 17 deletions.
55 changes: 38 additions & 17 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,6 @@ use FindBin;
use lib "$FindBin::Bin/lib";
use DBIx::Class::Optional::Dependencies;

# adjust ENV for $AUTHOR system() calls
use Config;
$ENV{PERL5LIB} = join ($Config{path_sep}, @INC);

use Getopt::Long ();

my $getopt = Getopt::Long::Parser->new(
config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/]
);
my $args = {
skip_author_deps => undef,
};
$getopt->getoptions($args, 'skip_author_deps');
if (@ARGV) {
warn "\nIgnoring unrecognized option(s): @ARGV\n\n";
}

# get cpanX --installdeps . to behave in a checkout (most users do not need
# the deps for a full test suite run, and if they do - there's MI::AutoInstall
# for that)
Expand Down Expand Up @@ -86,6 +69,40 @@ my $runtime_requires = {
'File::Path' => '2.07',
};


# Bail out on parallel testing
if (
($ENV{HARNESS_OPTIONS}||'') =~ / (?: ^ | \: ) j(\d+) /x
and
$1 > 1
) { die <<EOP }
******************************************************************************
******************************************************************************
*** ***
*** PARALLEL TESTING DETECTED ( \$ENV{HARNESS_OPTIONS} = 'j$1' ) ***
*** ***
*** DBIC tests will fail. It is harder to make them parallel-friendly than ***
*** it should be (though work is underway). In the meantime you will have ***
*** to adjust your environment and re-run the installation. Sorry! ***
*** ***
******************************************************************************
******************************************************************************
EOP

require Getopt::Long;
my $getopt = Getopt::Long::Parser->new(
config => [qw/gnu_getopt bundling_override no_ignore_case pass_through/]
);
my $args = {
skip_author_deps => undef,
};
$getopt->getoptions($args, 'skip_author_deps');
if (@ARGV) {
warn "\nIgnoring unrecognized option(s): @ARGV\n\n";
}

# this is so we can order requires alphabetically
# copies are needed for author requires injection
my $reqs = {
Expand Down Expand Up @@ -172,6 +189,10 @@ warn $optdep_msg if $Module::Install::AUTHOR;
# re-create various autogenerated documentation bits
if ($Module::Install::AUTHOR) {

# adjust ENV for $AUTHOR system() calls
require Config;
$ENV{PERL5LIB} = join ($Config::Config{path_sep}, @INC);

print "Regenerating README\n";
system('pod2text lib/DBIx/Class.pm > README');

Expand Down

0 comments on commit bb7950c

Please sign in to comment.