File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed
Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change 11# !perl -w
22use strict;
3- BEGIN { $ENV {' PERL_DL_NONLAZY' } = 1 }
3+ use warnings;
4+ use Test::More;
5+ BEGIN { $ENV {' PERL_DL_NONLAZY' } = 1 }
6+
7+ my @warnings ;
8+ $SIG {__WARN__ } = sub { push @warnings , @_ };
49
510require Tk;
6- # $SIG{__WARN__} = sub { die shift };
711my ($dir ) = $INC {' Tk.pm' } =~ / ^(.*)\. pm$ / ;
812opendir (TK,$dir ) || die " Cannot opendir $dir :$! " ;
913my @files = grep (/ \. pm$ / ,readdir (TK));
1014closedir (TK);
11- my $file ;
12- $Test::ntest = @files ;
13- print " 1.." ,$Test::ntest ," \n " ;
14- my $count = 1;
15- foreach $file (@files )
15+
16+ plan tests => 1 + @files ;
17+
18+ for my $file (@files )
1619 {
1720 if ($file =~ / \. pm$ / )
1821 {
19- # print "Tk/$file\n";
2022 eval { require " Tk/$file " };
21- if ($@ )
22- {
23- warn " Tk/$file : $@ " ;
24- print " not " ;
25- }
26- print " ok " ,$count ++," \n " ;
23+ ok !$@ , " Tk/$file compiled" or diag $@ ;
2724 }
2825 }
2926
27+ is_deeply \@warnings , [], ' no warnings' ;
You can’t perform that action at this time.
0 commit comments