diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 20:15:44 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 20:15:44 +0000 |
commit | 1a42a93b11c48e696446250f2a1f1ca71b350e9b (patch) | |
tree | 900e3702d59f6d7cae8f7def94ed5194602f6846 /t/size.t | |
parent | Initial commit. (diff) | |
download | debhelper-1a42a93b11c48e696446250f2a1f1ca71b350e9b.tar.xz debhelper-1a42a93b11c48e696446250f2a1f1ca71b350e9b.zip |
Adding upstream version 13.3.4.upstream/13.3.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 't/size.t')
-rwxr-xr-x | t/size.t | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/t/size.t b/t/size.t new file mode 100755 index 0000000..e759a47 --- /dev/null +++ b/t/size.t @@ -0,0 +1,32 @@ +#!/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 strict; +use warnings; +use Test::More; + +my $binpath = $ENV{AUTOPKGTEST_TMP} ? '/usr/bin' : '.'; +my @progs=grep { -x $_ } glob("$binpath/dh_*"); + +plan(tests => (@progs + @progs)); + +foreach my $file (@progs) { + + my $lines=0; + my $maxlength=0; + open(my $fd, '<', $file) || die "open($file): $!"; + my $cutting=0; + while (<$fd>) { + $cutting=1 if /^=/; + $cutting=0 if /^=cut/; + next if $cutting || /^(?:=|\s*(?:\#.*|[}]\s*)?$)/; + $lines++; + $maxlength=length($_) if length($_) > $maxlength; + } + close($fd); + print "# $file has $lines lines, max length is $maxlength\n"; + ok($lines < 200, $file); + ok($maxlength < 160, $file); +} |