summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2016-05-07 08:58:39 -0700
committerSean Whitton <spwhitton@spwhitton.name>2016-05-07 08:58:39 -0700
commite5b967a556440c585cca53d1f104f9e0df9b6df6 (patch)
treeb30dcd6327810148ff443c901a09c0b75b2d71e1 /lib
parent65996d920718418bcacb7c49a1228fd35bdd0fe0 (diff)
detect and activate buttercup tests
Diffstat (limited to 'lib')
-rw-r--r--lib/DhMakeELPA/Command/Packaging.pm16
-rw-r--r--lib/DhMakeELPA/Command/make.pm2
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/DhMakeELPA/Command/Packaging.pm b/lib/DhMakeELPA/Command/Packaging.pm
index e777a54..d992ae2 100644
--- a/lib/DhMakeELPA/Command/Packaging.pm
+++ b/lib/DhMakeELPA/Command/Packaging.pm
@@ -9,6 +9,7 @@ use File::Grep qw{fgrep};
use Array::Utils qw{array_minus};
use DhMakeELPA::MELPA;
use File::Copy;
+use File::Find::Rule;
use File::Spec::Functions qw(catfile);
use Git::Repository;
@@ -271,4 +272,19 @@ sub create_watch {
}
}
+sub detect_buttercup_tests {
+ my $self = shift;
+
+ my @files = File::Find::Rule
+ ->file()
+ ->grep( "\\(describe " )
+ ->in('.');
+
+ if ( scalar @files ) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
1;
diff --git a/lib/DhMakeELPA/Command/make.pm b/lib/DhMakeELPA/Command/make.pm
index 91ba8bb..3f7818d 100644
--- a/lib/DhMakeELPA/Command/make.pm
+++ b/lib/DhMakeELPA/Command/make.pm
@@ -49,6 +49,8 @@ sub create_control {
$src->Standards_Version( $self->debstdversion );
$src->Build_Depends->add( "debhelper (>= 9.20160402)" );
$src->Build_Depends->add( "dh-elpa" );
+ $src->Build_Depends->add( "elpa-buttercup" )
+ if ( $self->detect_buttercup_tests() );
$src->Homepage( $self->homepage ) if ( defined $self->homepage );
$self->fill_maintainer();