Commit | Line | Data |
---|---|---|
35bab742 | 1 | #!/usr/bin/perl |
2 | # vim: set ft=perl: | |
3 | # | |
4 | # This test attempts to load every .pm file in MANIFEST. | |
5 | # It might be naive. | |
6 | # | |
7 | ||
8 | my @perlmods; | |
44fb27ae | 9 | |
10 | use Test::More; | |
11 | use SQL::Translator; | |
35bab742 | 12 | |
13 | unless (open MANIFH, "MANIFEST") { | |
44fb27ae | 14 | plan skip_all => "Can't open MANIFEST! ($!)"; |
35bab742 | 15 | exit; |
16 | } | |
44fb27ae | 17 | |
35bab742 | 18 | while (<MANIFH>) { |
19 | chomp; | |
20 | if (s/\.pm$//) { | |
21 | s,/,::,g; | |
35bab742 | 22 | push @perlmods, $_ |
23 | } | |
24 | } | |
25 | ||
35bab742 | 26 | close MANIFH; |
27 | ||
44fb27ae | 28 | @perlmods = sort { length $a <=> length $b } @perlmods; # aesthetics |
29 | plan tests => scalar @perlmods; | |
30 | ||
35bab742 | 31 | for my $mod (@perlmods) { |
44fb27ae | 32 | SQL::Translator::load($mod); |
33 | ok(!$@, "use $mod"); | |
35bab742 | 34 | } |
35 |