File: size

package info (click to toggle)
debhelper 9.20150101
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 2,460 kB
  • sloc: perl: 5,757; makefile: 89; sh: 7
file content (29 lines) | stat: -rwxr-xr-x 721 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/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::More;

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 < 200, $file);
	ok($maxlength < 160, $file);
}