postgresql/config/check_modules.pl
Peter Eisentraut c538592959 Make all Perl warnings fatal
There are a lot of Perl scripts in the tree, mostly code generation
and TAP tests.  Occasionally, these scripts produce warnings.  These
are probably always mistakes on the developer side (true positives).
Typical examples are warnings from genbki.pl or related when you make
a mess in the catalog files during development, or warnings from tests
when they massage a config file that looks different on different
hosts, or mistakes during merges (e.g., duplicate subroutine
definitions), or just mistakes that weren't noticed because there is a
lot of output in a verbose build.

This changes all warnings into fatal errors, by replacing

    use warnings;

by

    use warnings FATAL => 'all';

in all Perl files.

Discussion: https://www.postgresql.org/message-id/flat/06f899fd-1826-05ab-42d6-adeb1fd5e200%40eisentraut.org
2023-12-29 18:20:00 +01:00

28 lines
881 B
Perl

#
# Verify that required Perl modules are available,
# in at least the required minimum versions.
# (The required minimum versions are all quite ancient now,
# but specify them anyway for documentation's sake.)
#
use strict;
use warnings FATAL => 'all';
use Config;
use IPC::Run 0.79;
# Test::More and Time::HiRes are supposed to be part of core Perl,
# but some distros omit them in a minimal installation.
use Test::More 0.98;
use Time::HiRes 1.52;
# While here, we might as well report exactly what versions we found.
diag("IPC::Run::VERSION: $IPC::Run::VERSION");
diag("Test::More::VERSION: $Test::More::VERSION");
diag("Time::HiRes::VERSION: $Time::HiRes::VERSION");
# Check that if prove is using msys perl it is for an msys target
ok( ($ENV{__CONFIG_HOST_OS__} || "") eq 'msys',
"Msys perl used for correct target") if $Config{osname} eq 'msys';
ok(1);
done_testing();