xref: /openbsd-src/gnu/usr.bin/perl/t/porting/checkcfgvar.t (revision 46035553bfdd96e63c94e32da0210227ec2e3cf1)
1#!./perl -w
2
3# What does this test?
4# This uses Porting/checkcfgvar.pl to check that none of the config.sh-like
5# files are missing any entries.
6#
7# Why do we test this?
8# We need them to be complete when we ship a release, and this way we catch
9# problems as early as possible. (Instead of creating the potential for yet
10# another last-minute job for the release manager). If a config file for a
11# platform is incomplete, it can't be used to correctly regenerate config.h,
12# because missing values result in invalid C code. We keep the files sorted
13# as it makes it easy to automate adding defaults.
14#
15# It's broken - how do I fix it?
16# The most likely reason that the test failed is because you've just added
17# a new entry to Configure, config.sh and config_h.SH but nowhere else.
18# Run something like:
19#   perl Porting/checkcfgvar.pl --regen --default=undef
20# (the correct default might not always be undef) to do most of the work, and
21# then hand-edit configure.com (as that's not automated).
22# If this changes uconfig.sh, you'll also need to run perl regen/uconfig_h.pl
23
24use Config;
25BEGIN {
26    require "./test.pl";
27    skip_all("Won't ship a release from EBCDIC") if $::IS_EBCDIC;
28    @INC = '..' if -f '../TestInit.pm';
29}
30use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute
31
32if ( $Config{usecrosscompile} ) {
33  skip_all( "Not all files are available during cross-compilation" );
34}
35
36system "$^X -Ilib Porting/checkcfgvar.pl --tap";
37