re-work installation to use a bse.cfg style file
[bse.git] / t / 900-kwalitee / 010-strict-warn.t
CommitLineData
15fb10f2
TC
1#!perl -w
2use strict;
15fb10f2 3use File::Find;
5bbf7309 4use Test::More;
15fb10f2
TC
5
6my @files;
7open MANIFEST, "< MANIFEST" or die "Cannot open MANIFEST";
8while (<MANIFEST>) {
9 chomp;
10 next if /^\s*\#/;
11 s/\s+.*//;
12 push @files, $_ if /\.(pm|t|pl)$/;
13}
14close MANIFEST;
15my @scripts = grep /\.(pl|t)$/, @files;
5bbf7309 16plan tests => scalar(@files) + scalar(@scripts);
15fb10f2
TC
17for my $file (@files) {
18 open SRC, "< $file" or die "Cannot open $file: $!";
19 my $data = do { local $/; <SRC> };
20 close SRC;
21 ok($data =~ /^use\s+strict/m, "use strict in $file");
22 if ($file =~ /\.(pl|t)$/) {
0da5d199 23 ok($data =~ /#!.*perl.*-w|use warnings;/m, "-w or use warnings in $file");
15fb10f2
TC
24 }
25}