Skip to content
Browse files

Support tap_harness_args in minil.toml

  • Loading branch information...
1 parent 4cbc601 commit 553773d531e2161406aabbf9e71d603057863c8a @tokuhirom committed Nov 3, 2013
Showing with 76 additions and 1 deletion.
  1. +2 −0 Build.PL
  2. +1 −1 META.json
  3. +7 −0 README.md
  4. +7 −0 lib/Minilla.pm
  5. +5 −0 lib/Minilla/ModuleMaker/ModuleBuild.pm
  6. +5 −0 lib/Minilla/Project.pm
  7. +5 −0 minil.toml
  8. +44 −0 t/module_maker/tap_harness_args.t
View
2 Build.PL
@@ -33,6 +33,8 @@ my %args = (
test_files => ((-d '.git' || $ENV{RELEASE_TESTING}) && -d 'xt') ? 't/ xt/' : 't/',
recursive_test_files => 1,
+
+ tap_harness_args => {"jobs" => 3},
);
if (-d 'share') {
View
2 META.json
@@ -4,7 +4,7 @@
"Tokuhiro Matsuno < tokuhirom@gmail.com >"
],
"dynamic_config" : 0,
- "generated_by" : "Minilla/v0.7.5, CPAN::Meta::Converter version 2.132510",
+ "generated_by" : "Minilla/v0.8.1, CPAN::Meta::Converter version 2.132510",
"license" : [
"perl_5"
],
View
7 README.md
@@ -152,6 +152,13 @@ But, you can write configurations to _minil.toml_ file in [TOML](https://github.
Minilla sets install script files as `['script/*', 'bin/*']` by default.
+- tap\_harness\_args(EXPERIMENTAL)
+
+ [tap_harness_args]
+ jobs=19
+
+ This parameters pass to TAP::Harness when running tests. See the [TAP::Harness](http://search.cpan.org/perldoc?TAP::Harness) documentation for details.
+
- license
license="artistic_2"
View
7 lib/Minilla.pm
@@ -181,6 +181,13 @@ linking phases of any C or XS files.
Minilla sets install script files as C<< ['script/*', 'bin/*'] >> by default.
+=item tap_harness_args(EXPERIMENTAL)
+
+ [tap_harness_args]
+ jobs=19
+
+This parameters pass to TAP::Harness when running tests. See the L<TAP::Harness> documentation for details.
+
=item license
license="artistic_2"
View
5 lib/Minilla/ModuleMaker/ModuleBuild.pm
@@ -48,6 +48,7 @@ __DATA__
@@ Build.PL
? my $project = shift;
+? use Data::Dumper;
# =========================================================================
# THIS FILE IS AUTOMATICALLY GENERATED BY MINILLA.
# DO NOT EDIT DIRECTLY.
@@ -83,6 +84,10 @@ my %args = (
test_files => ((-d '.git' || $ENV{RELEASE_TESTING}) && -d 'xt') ? 't/ xt/' : 't/',
recursive_test_files => 1,
+
+? if( $project->tap_harness_args ){
+ tap_harness_args => <?= Dumper($project->tap_harness_args) ?>,
+? }
? if( $project->use_xsutil ){
needs_compiler_c99 => <?= $project->needs_compiler_c99 ?>,
View
5 lib/Minilla/Project.pm
@@ -132,6 +132,11 @@ sub badges {
$self->config->{badges} || [];
}
+sub tap_harness_args {
+ my $self = shift;
+ $self->config->{tap_harness_args};
+}
+
sub use_xsutil {
my $self = shift;
return defined $self->config->{XSUtil} ? 1 : 0;
View
5 minil.toml
@@ -0,0 +1,5 @@
+name="Minilla"
+authority = "cpan:TOKUHIROM"
+
+[tap_harness_args]
+jobs=3
View
44 t/module_maker/tap_harness_args.t
@@ -0,0 +1,44 @@
+use strict;
+use warnings;
+use utf8;
+use Test::More;
+use t::Util;
+
+use Minilla::Profile::ModuleBuild;
+use Minilla::Project;
+
+test(sub {
+ like(slurp('Build.PL'), qr{tap_harness_args\s*=>\s*{\s*"jobs"\s*=>\s*9\s*}});
+});
+
+done_testing;
+
+sub test {
+ my $code = shift;
+
+ my $guard = pushd(tempdir());
+
+ Minilla::Profile::ModuleBuild->new(
+ author => 'hoge',
+ dist => 'Acme-Foo',
+ module => 'Acme::Foo',
+ path => 'Acme/Foo.pm',
+ version => '0.01',
+ )->generate();
+
+ spew('MANIFEST', <<'...');
+ Build.PL
+ lib/Acme/Foo.pm
+...
+
+ write_minil_toml({
+ name => 'Acme-Foo',
+ tap_harness_args => {
+ jobs => 9,
+ },
+ });
+ git_init_add_commit();
+ Minilla::Project->new()->regenerate_files();
+ git_init_add_commit();
+ $code->();
+}

0 comments on commit 553773d

Please sign in to comment.
Something went wrong with that request. Please try again.