[ Joey Hess]
* move po4a to Build-Depends as it's run in clean.
+ * Add size test, which fails on any debhelper program of more than 150
+ lines. This is not a joke, and 100 lines would be better.
-- Joey Hess <joeyh@debian.org> Sun, 2 Jul 2006 18:11:49 -0400
LANGS=$(notdir $(basename $(wildcard man/po4a/po/*.po)))
version:
- printf "package Debian::Debhelper::Dh_Version;\n\$$version='$(VERSION)';" > \
+ printf "package Debian::Debhelper::Dh_Version;\n\$$version='$(VERSION)';\n1" > \
Debian/Debhelper/Dh_Version.pm
build: version test build-stamp
--- /dev/null
+#!/usr/bin/perl
+# This may appear arbitrary, but DO NOT CHANGE IT.
+# Debhelper is supposed to consist of small, simple, easy to understand
+# programs. Programs growing in size and complexity without bounds is a
+# bug.
+use Test;
+
+my @progs=grep { -x $_ } glob("dh_*");
+
+plan(tests => (@progs + @progs));
+
+foreach my $file (@progs) {
+ my $lines=0;
+ my $maxlength=0;
+ open(IN, $file) || die "open: $!";
+ my $cutting=0;
+ while (<IN>) {
+ $cutting=1 if /^=/;
+ $cutting=0 if /^=cut/;
+ next if $cutting || /^(=|\s*\#)/;
+ $lines++;
+ $maxlength=length($_) if length($_) > $maxlength;
+ }
+ close IN;
+ print "# $file has $lines lines, max length is $maxlength\n";
+ ok($lines < 150);
+ ok($maxlength < 160);
+}