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