summaryrefslogtreecommitdiff
path: root/dh_elpa_test
diff options
context:
space:
mode:
Diffstat (limited to 'dh_elpa_test')
-rwxr-xr-xdh_elpa_test26
1 files changed, 25 insertions, 1 deletions
diff --git a/dh_elpa_test b/dh_elpa_test
index b46875e..766cf81 100755
--- a/dh_elpa_test
+++ b/dh_elpa_test
@@ -95,10 +95,33 @@ B<dh_elpa_test> invokes Emacs to run ERT tests.
use File::Find::Rule;
use Array::Utils qw{ array_minus };
+use Text::Glob qw{ glob_to_regex };
use Debian::Debhelper::Dh_Lib;
use Debian::Control;
+# ---- Subroutines
+
+# like Find::File::Rule::name, but matches the whole path of the file
+# (relative to cwd when search was started) against the glob, rather
+# than just the basename (also, unlike Find::File::Rule::name, accepts
+# a single glob and no regexps since that's all we need here)
+sub long_name {
+ my $glob = shift;
+
+ return sub {
+ ( undef, undef, my $fullname ) = @_;
+
+ if ( $fullname =~ glob_to_regex($glob) ) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+}
+
+# ---- Script setup
+
# This checks whether the debhelper compat is 10 or above. With
# debhelper compat below 9, dh_elpa_test will get run more in more
# than one sequence, including inside fakeroot, which can cause tests
@@ -146,7 +169,7 @@ $rule
->grep( "ert-deftest" );
if (defined $ENV{'DH_ELPA_TEST_ERT_EXCLUDE'}) {
foreach my $glob (split(',', $ENV{'DH_ELPA_TEST_ERT_EXCLUDE'})) {
- $rule->not_name($glob);
+ $rule->not_exec( long_name($glob) );
}
}
my @ert_files = $rule->in('.');
@@ -202,6 +225,7 @@ Here is an example of using the helper in a dh(1) style debian/rules
#!/usr/bin/make -f
export DH_ELPA_TEST_BUTTERCUP_LOAD_PATH=lib,other_lib
+ export DH_ELPA_TEST_ERT_EXCLUDE=broken-tests/*.el
%:
dh $@ --with elpa