summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2017-01-10 08:36:53 -0700
committerSean Whitton <spwhitton@spwhitton.name>2017-01-10 08:36:53 -0700
commit70bc90c9a50b2bbc3e7e2a4843c05fe524bda51b (patch)
tree6ebc607416e03bc12e195f9d986ab6a3d1fd4b97 /lib
parent549af691b4494c56ab8a5b048d384dab7074e2de (diff)
don't unconditionally generate Testsuite:
Diffstat (limited to 'lib')
-rw-r--r--lib/DhMakeELPA/Command/make.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/DhMakeELPA/Command/make.pm b/lib/DhMakeELPA/Command/make.pm
index 59153ff..fd75211 100644
--- a/lib/DhMakeELPA/Command/make.pm
+++ b/lib/DhMakeELPA/Command/make.pm
@@ -8,6 +8,7 @@ use Debian::Control;
use File::Spec::Functions qw(catfile);
use Email::Date::Format qw(email_date);
use File::Grep qw(fgrep);
+use File::Find::Rule;
use Cwd;
use base 'DhMakeELPA::Command::Packaging';
@@ -49,7 +50,6 @@ sub create_control {
$src->Source( $self->pkgname );
$src->Section("lisp");
$src->Priority("optional");
- $src->Testsuite("autopkgtest-pkg-elpa");
$src->Standards_Version( $self->debstdversion );
$src->Build_Depends->add( "debhelper (>= 10)" );
$src->Build_Depends->add( "dh-elpa" );
@@ -60,6 +60,20 @@ sub create_control {
$self->fill_maintainer();
$self->fill_vcs();
+ # simple checks for existence of Buttercup or ERT tests, based on
+ # code in dh_elpa_test
+ my $rule = File::Find::Rule->new;
+ $rule
+ ->file()
+ ->name( '*.el' )
+ ->or(
+ # ERT
+ File::Find::Rule ->grep( "ert-deftest" ),
+ # Buttercup
+ File::Find::Rule ->grep( "(describe \"" )
+ );
+ $src->Testsuite("autopkgtest-pkg-elpa") if ( $rule->in('.') );
+
foreach my $bin (keys %{$self->bins}) {
my @files = @{$self->bins->{$bin}};
# resolve special case so we can use fgrep