Commit | Line | Data |
281738a4 |
1 | use warnings; |
2 | use strict; |
3 | |
4 | use Test::More; |
7e1ca6dd |
5 | use File::Glob 'bsd_glob'; |
281738a4 |
6 | use lib 't/lib'; |
7 | use DBICTest; |
a8064486 |
8 | |
d146b340 |
9 | require DBIx::Class; |
10 | unless ( DBIx::Class::Optional::Dependencies->req_ok_for ('test_notabs') ) { |
11 | my $missing = DBIx::Class::Optional::Dependencies->req_missing_for ('test_notabs'); |
20884f55 |
12 | $ENV{RELEASE_TESTING} |
d146b340 |
13 | ? die ("Failed to load release-testing module requirements: $missing") |
14 | : plan skip_all => "Test needs: $missing" |
a8064486 |
15 | } |
16 | |
7e1ca6dd |
17 | # FIXME - temporary workaround for RT#82033 |
331886ef |
18 | # also add all scripts (no extension) and some extra extensions |
19 | # we want to check |
7e1ca6dd |
20 | { |
21 | no warnings 'redefine'; |
331886ef |
22 | |
23 | *Test::EOL::_is_perl_module = sub { |
24 | $_[0] !~ /\./ || $_[0] =~ /\.(?:pm|pod|skip|json|proto)$/i || $_[0] =~ /::/; |
7e1ca6dd |
25 | } |
26 | } |
27 | |
f90896ae |
28 | Test::NoTabs::all_perl_files_ok( |
95252a8c |
29 | qw/t xt lib script examples maint/, |
f90896ae |
30 | ); |
281738a4 |
31 | |
7e1ca6dd |
32 | # check some non-"perl files" in the root separately |
33 | # use .gitignore as a guide of what to skip |
34 | # (or do not test at all if no .gitignore is found) |
35 | if (open(my $gi, '<', '.gitignore')) { |
36 | my $skipnames; |
37 | while (my $ln = <$gi>) { |
38 | next if $ln =~ /^\s*$/; |
39 | chomp $ln; |
40 | $skipnames->{$_}++ for bsd_glob($ln); |
41 | } |
42 | |
43 | for my $fn (bsd_glob('*')) { |
44 | next if $skipnames->{$fn}; |
45 | next unless -f $fn; |
46 | Test::NoTabs::notabs_ok($fn); |
47 | } |
48 | } |
a8b66abc |
49 | |
8273e845 |
50 | # FIXME - Test::NoTabs declares 'no_plan' which conflicts with done_testing |
51 | # https://github.com/schwern/test-more/issues/14 |
d146b340 |
52 | #done_testing; |