xref: /openbsd-src/gnu/usr.bin/perl/t/porting/checkcfgvar.t (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
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    @INC = '..' if -f '../TestInit.pm';
28}
29use TestInit qw(T A); # T is chdir to the top level, A makes paths absolute
30
31if ( $Config{usecrosscompile} ) {
32  skip_all( "Not all files are available during cross-compilation" );
33}
34
35system "$^X Porting/checkcfgvar.pl --tap";
36