]> git.donarmstrong.com Git - debhelper.git/blob - t/size
cmake: Pass CPPFLAGS in CFLAGS. Closes: #668813 Thanks, Simon Ruderich for the patch...
[debhelper.git] / t / size
1 #!/usr/bin/perl
2 # This may appear arbitrary, but DO NOT CHANGE IT.
3 # Debhelper is supposed to consist of small, simple, easy to understand
4 # programs. Programs growing in size and complexity without bounds is a
5 # bug.
6 use Test::More;
7
8 # exclude dh_python since it's deprecated
9 my @progs=grep { -x $_ && !/dh_python/ } glob("dh_*");
10
11 plan(tests => (@progs + @progs));
12
13 foreach my $file (@progs) {
14
15         my $lines=0;
16         my $maxlength=0;
17         open(IN, $file) || die "open: $!";
18         my $cutting=0;
19         while (<IN>) {
20                 $cutting=1 if /^=/;
21                 $cutting=0 if /^=cut/;
22                 next if $cutting || /^(=|\s*\#)/;
23                 $lines++;
24                 $maxlength=length($_) if length($_) > $maxlength;
25         }
26         close IN;
27         print "# $file has $lines lines, max length is $maxlength\n";
28         ok($lines < 200, $file);
29         ok($maxlength < 160, $file);
30 }