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   13972 use 5.006;
  2         6  
4 2     2   7 use strict;
  2         1  
  2         52  
5 2     2   9 use warnings;
  2         5  
  2         317  
6              
7             package Test::BrewBuild::Plugin::TestAgainst;
8              
9             our $VERSION = '0.05';
10              
11             my $state = bless {}, __PACKAGE__;
12              
13             sub brewbuild_exec{
14 1     1 1 442 shift; # throw away class
15 1         2 my $log = shift;
16 1         2 my $module = shift;
17 1         4 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       8 if (! defined $state->{raw}){
26 1         12 @{ $state->{raw} } = ;
  1         5  
27             }
28              
29 1         3 my @cmd = @{ $state->{raw} };
  1         4  
30              
31 1         3 for (@cmd){
32 4         9 s/%\[MODULE\]%/$module/g;
33             }
34              
35 1         6 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__