-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from doy/master
make dzil test with the appropriate options run xt tests
- Loading branch information
Showing
17 changed files
with
431 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Changes | ||
|
||
1.23 2009-11-16 19:15:45 CET | ||
- foo | ||
- bar | ||
- baz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
|
||
use strict; | ||
use warnings; | ||
|
||
|
||
|
||
use ExtUtils::MakeMaker 6.30; | ||
|
||
{ | ||
my $contents = do { | ||
open my $fh, '<', 'lib/Foo.pm' || die "Couldn't open lib/Foo.pm: $!"; | ||
local $/; | ||
<$fh>; | ||
}; | ||
$contents =~ s/123/456/; | ||
open my $fh, '>', 'lib/Foo.pm' || die "Couldn't open lib/Foo.pm: $!"; | ||
print $fh $contents; | ||
} | ||
|
||
|
||
my %WriteMakefileArgs = ( | ||
"ABSTRACT" => "Test Library", | ||
"AUTHOR" => "foobar", | ||
"BUILD_REQUIRES" => {}, | ||
"CONFIGURE_REQUIRES" => { | ||
"ExtUtils::MakeMaker" => "6.30" | ||
}, | ||
"DISTNAME" => "Foo", | ||
"EXE_FILES" => [], | ||
"LICENSE" => "perl", | ||
"NAME" => "Foo", | ||
"PREREQ_PM" => {}, | ||
"VERSION" => "1.23", | ||
"test" => { | ||
"TESTS" => "" | ||
} | ||
); | ||
|
||
|
||
unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { | ||
my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; | ||
my $pp = $WriteMakefileArgs{PREREQ_PM}; | ||
for my $mod ( keys %$br ) { | ||
if ( exists $pp->{$mod} ) { | ||
$pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; | ||
} | ||
else { | ||
$pp->{$mod} = $br->{$mod}; | ||
} | ||
} | ||
} | ||
|
||
delete $WriteMakefileArgs{CONFIGURE_REQUIRES} | ||
unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; | ||
|
||
WriteMakefile(%WriteMakefileArgs); | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name = Foo | ||
version = 1.23 | ||
author = foobar | ||
license = Perl_5 | ||
abstract = Test Library | ||
copyright_holder = foobar | ||
copyright_year = 2009 | ||
|
||
[@Filter] | ||
bundle = @FakeClassic | ||
remove = ExtraTests | ||
remove = PodVersion | ||
remove = PodSyntaxTests | ||
remove = PodCoverageTests | ||
remove = ConfirmRelease | ||
remove = UploadToCPAN | ||
remove = MakeMaker | ||
|
||
[MakeMaker::Runner] | ||
|
||
[CheckExtraTests] | ||
[RunExtraTests] | ||
|
||
[FakeRelease] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
this file is meant for testing... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package Foo; | ||
use strict; | ||
use warnings; | ||
# ABSTRACT: Foo this thing | ||
|
||
sub foo { 123 } | ||
|
||
1; | ||
|
||
=head1 DESCRIPTION | ||
Foo the foo. | ||
=cut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env perl | ||
use strict; | ||
use warnings; | ||
use Test::More; | ||
|
||
pass("success"); | ||
|
||
done_testing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Changes | ||
|
||
1.23 2009-11-16 19:15:45 CET | ||
- foo | ||
- bar | ||
- baz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
|
||
use strict; | ||
use warnings; | ||
|
||
|
||
|
||
use ExtUtils::MakeMaker 6.30; | ||
|
||
{ | ||
my $contents = do { | ||
open my $fh, '<', 'lib/Foo.pm' || die "Couldn't open lib/Foo.pm: $!"; | ||
local $/; | ||
<$fh>; | ||
}; | ||
$contents =~ s/123/456/; | ||
open my $fh, '>', 'lib/Foo.pm' || die "Couldn't open lib/Foo.pm: $!"; | ||
print $fh $contents; | ||
} | ||
|
||
|
||
my %WriteMakefileArgs = ( | ||
"ABSTRACT" => "Test Library", | ||
"AUTHOR" => "foobar", | ||
"BUILD_REQUIRES" => {}, | ||
"CONFIGURE_REQUIRES" => { | ||
"ExtUtils::MakeMaker" => "6.30" | ||
}, | ||
"DISTNAME" => "Foo", | ||
"EXE_FILES" => [], | ||
"LICENSE" => "perl", | ||
"NAME" => "Foo", | ||
"PREREQ_PM" => {}, | ||
"VERSION" => "1.23", | ||
"test" => { | ||
"TESTS" => "" | ||
} | ||
); | ||
|
||
|
||
unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) { | ||
my $br = delete $WriteMakefileArgs{BUILD_REQUIRES}; | ||
my $pp = $WriteMakefileArgs{PREREQ_PM}; | ||
for my $mod ( keys %$br ) { | ||
if ( exists $pp->{$mod} ) { | ||
$pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod}; | ||
} | ||
else { | ||
$pp->{$mod} = $br->{$mod}; | ||
} | ||
} | ||
} | ||
|
||
delete $WriteMakefileArgs{CONFIGURE_REQUIRES} | ||
unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; | ||
|
||
WriteMakefile(%WriteMakefileArgs); | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name = Foo | ||
version = 1.23 | ||
author = foobar | ||
license = Perl_5 | ||
abstract = Test Library | ||
copyright_holder = foobar | ||
copyright_year = 2009 | ||
|
||
[@Filter] | ||
bundle = @FakeClassic | ||
remove = ExtraTests | ||
remove = PodVersion | ||
remove = PodSyntaxTests | ||
remove = PodCoverageTests | ||
remove = ConfirmRelease | ||
remove = UploadToCPAN | ||
remove = MakeMaker | ||
|
||
[MakeMaker::Runner] | ||
|
||
[CheckExtraTests] | ||
|
||
[FakeRelease] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
this file is meant for testing... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package Foo; | ||
use strict; | ||
use warnings; | ||
# ABSTRACT: Foo this thing | ||
|
||
sub foo { 123 } | ||
|
||
1; | ||
|
||
=head1 DESCRIPTION | ||
Foo the foo. | ||
=cut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
use strict; | ||
use warnings; | ||
package Dist::Zilla::Plugin::RunExtraTests; | ||
# ABSTRACT: support running xt tests via dzil test | ||
# VERSION | ||
|
||
# Dependencies | ||
use Dist::Zilla 2.100950 (); # XXX really the next release after this date | ||
use App::Prove 3.00 (); | ||
use Moose 0.99; | ||
use namespace::autoclean 0.09; | ||
|
||
# extends, roles, attributes, etc. | ||
|
||
with 'Dist::Zilla::Role::TestRunner'; | ||
|
||
# methods | ||
|
||
sub test { | ||
my $self = shift; | ||
|
||
my @dirs; | ||
push @dirs, 'xt/release' if $ENV{RELEASE_TESTING}; | ||
push @dirs, 'xt/author' if $ENV{AUTHOR_TESTING}; | ||
push @dirs, 'xt/smoke' if $ENV{AUTOMATED_TESTING}; | ||
@dirs = grep { -d } @dirs; | ||
return unless @dirs; | ||
|
||
my @builders = @{ $self->zilla->plugins_with(-BuildRunner) }; | ||
die "no BuildRunner plugins specified" unless @builders; | ||
$builders[0]->build; | ||
|
||
my $app = App::Prove->new; | ||
$app->process_args(qw/-r -b/, @dirs); | ||
$app->run or $self->log_fatal("Fatal errors in xt tests"); | ||
return; | ||
} | ||
|
||
__PACKAGE__->meta->make_immutable; | ||
|
||
1; | ||
|
||
__END__ | ||
=for Pod::Coverage::TrustPod | ||
test | ||
=begin wikidoc | ||
= SYNOPSIS | ||
In your dist.ini: | ||
[RunExtraTests] | ||
= DESCRIPTION | ||
Runs xt tests when C<dzil test> is run. C<xt/release>, C<xt/author>, and | ||
C<xt/smoke> will be tested based on the values of the appropriate environment | ||
variables (C<RELEASE_TESTING>, C<AUTHOR_TESTING>, and C<AUTOMATED_TESTING>), | ||
which are set by C<dzil test>. | ||
= SEE ALSO | ||
* [Dist::Zilla] | ||
=end wikidoc | ||
=cut | ||
Oops, something went wrong.