po: Update German man pages translation
[dpkg.git] / t / codespell.t
blob13d66ee1d80e83952be533588e7b7f85290297e5
1 #!/usr/bin/perl
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 use strict;
17 use warnings;
19 use Test::More;
20 use Test::Dpkg qw(:needs);
22 test_needs_author();
23 test_needs_command('codespell');
24 test_needs_srcdir_switch();
26 plan tests => 1;
28 my @codespell_skip = qw(
29 .git
30 *.po
31 *.pot
32 *.gmo
33 *.add
34 *.cache
36 .libs
37 .deps
38 ChangeLog
39 Makefile.in
40 Makefile
41 configure
42 config.*
43 libtool
44 libtool.m4
45 aclocal.m4
46 autom4te.cache
47 _build
48 build-aux
49 build-tree
50 tmp
52 my $codespell_skip = join ',', @codespell_skip;
54 my @codespell_opts = (qw(
55 --ignore-words=t/codespell/stopwords
56 ), (
57 "--skip=$codespell_skip"
58 ));
59 my $tags = qx(codespell @codespell_opts 2>&1);
61 # Fixup the output:
62 $tags =~ s/^WARNING: Binary file:.*\n//mg;
63 $tags =~ s{^\./build-aux/.*\n}{}mg;
64 $tags =~ s{^\./man/[a-zA-Z_]+/.*\n}{}mg;
65 # XXX: Ignore python-3.8 runtime warnings:
66 $tags =~ s{^.*: RuntimeWarning: line buffering .*\n}{}mg;
67 $tags =~ s{^\s*file = builtins.open.*\n}{}mg;
68 chomp $tags;
70 my $ok = length $tags == 0;
72 ok($ok, 'codespell');
73 if (not $ok) {
74 diag($tags);