3 # Check that too-new features of Perl are not being used.
5 # This version of the check script supports mapping various directories to
6 # different version numbers. This allows a newer version of Perl to be
7 # required for internal tools than for public code.
9 # The canonical version of this file is maintained in the rra-c-util package,
10 # which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
12 # Written by Russ Allbery <eagle@eyrie.org>
13 # Copyright 2016 Russ Allbery <eagle@eyrie.org>
14 # Copyright 2012, 2013, 2014
15 # The Board of Trustees of the Leland Stanford Junior University
17 # Permission is hereby granted, free of charge, to any person obtaining a
18 # copy of this software and associated documentation files (the "Software"),
19 # to deal in the Software without restriction, including without limitation
20 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
21 # and/or sell copies of the Software, and to permit persons to whom the
22 # Software is furnished to do so, subject to the following conditions:
24 # The above copyright notice and this permission notice shall be included in
25 # all copies or substantial portions of the Software.
27 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
30 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
32 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
33 # DEALINGS IN THE SOFTWARE.
39 use lib "$ENV{C_TAP_SOURCE}/tap/perl";
42 use Test::RRA qw(skip_unless_automated use_prereq);
43 use Test::RRA::Automake qw(automake_setup perl_dirs);
44 use Test::RRA::Config qw($MINIMUM_VERSION %MINIMUM_VERSION);
46 # Skip for normal user installs since this doesn't affect functionality.
47 skip_unless_automated('Minimum version tests');
49 # Load prerequisite modules.
50 use_prereq('Test::MinimumVersion');
52 # Set up Automake testing.
55 # For each exception case in %MINIMUM_VERSION, check the files that should
56 # have that minium version. Sort for reproducible test order. Also
57 # accumulate the list of directories we've already tested.
59 for my $version (sort keys %MINIMUM_VERSION) {
60 my $paths_ref = $MINIMUM_VERSION{$version};
61 all_minimum_version_ok($version, { paths => $paths_ref, no_plan => 1 });
62 push(@tested, @{$paths_ref});
65 # Now, check anything that's left against the default minimum version.
66 my @paths = perl_dirs({ skip => [@tested] });
67 all_minimum_version_ok($MINIMUM_VERSION, { paths => \@paths, no_plan => 1 });
69 # Tell the TAP harness that we're done.