File Coverage

blib/lib/Test/BrewBuild/Plugin/TestAgainst.pm
Criterion Covered Total %
statement 21 21 100.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 28 29 96.5


line stmt bran cond sub pod time code
1             package Test::BrewBuild::Plugin::TestAgainst;
2              
3 2     2   16666 use 5.006;
  2         8  
4 2     2   10 use strict;
  2         3  
  2         48  
5 2     2   9 use warnings;
  2         10  
  2         478  
6              
7             package Test::BrewBuild::Plugin::TestAgainst;
8              
9             our $VERSION = '0.04';
10              
11             my $state = bless {}, __PACKAGE__;
12              
13             sub brewbuild_exec{
14 1     1 1 462 shift; # throw away class
15 1         2 my $log = shift;
16 1         1 my $module = shift;
17 1         5 return _cmd($module);
18             }
19             sub _cmd {
20 1     1   2 my $module = shift;
21              
22             #FIXME: we have to do the below nonsense, because DATA can't
23             # be opened twice if we get called more than once per run
24              
25 1 50       6 if (! defined $state->{raw}){
26 1         11 @{ $state->{raw} } = ;
  1         4  
27             }
28              
29 1         2 my @cmd = @{ $state->{raw} };
  1         3  
30              
31 1         3 for (@cmd){
32 3         8 s/%\[MODULE\]%/$module/g;
33             }
34              
35 1         4 return @cmd;
36             }
37              
38             1;
39              
40             =head1 NAME
41              
42             Test::BrewBuild::Plugin::TestAgainst - Test external modules against current
43             builds of the one being tested
44              
45             =head1 SYNOPSIS
46              
47             brewbuild --plugin Test::BrewBuild::Plugin::TestAgainst --args Rev::Dep
48              
49             =head1 DESCRIPTION
50              
51             This is a plugin for L. The plugin sub takes the name of a
52             module, and after testing and installing of the revision of the local module,
53             it'll run the test suite of the external module to ensure it passes with the
54             current prerequisite codebase.
55              
56             Useful mainly for testing reverse dependencies of the module you're currently
57             working on.
58              
59             =head1 FUNCTIONS
60              
61             =head2 brewbuild_exec($module_name);
62              
63             Takes the name of the module, and returns back the appropriate configuration
64             commands to L.
65              
66             =head1 AUTHOR
67              
68             Steve Bertrand, C<< >>
69              
70             =head1 COPYRIGHT & LICENSE
71              
72             Same as L
73              
74             =cut
75              
76             __DATA__