From: Russ Allbery Date: Thu, 10 Jan 2013 04:19:44 +0000 (-0800) Subject: Add a test for the minimum version of Perl X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=3abd2760c5a57c8982da1a461c353df2d919f041;p=packages%2Fa%2Fafs-monitor.git Add a test for the minimum version of Perl --- diff --git a/t/minimum-version.t b/t/minimum-version.t new file mode 100755 index 0000000..8872356 --- /dev/null +++ b/t/minimum-version.t @@ -0,0 +1,31 @@ +#!/usr/bin/perl +# +# Check that too-new features of Perl are not being used. +# +# Written by Russ Allbery +# +# The authors hereby relinquish any claim to any copyright that they may have +# in this work, whether granted under contract or by operation of law or +# international treaty, and hereby commit to the public, at large, that they +# shall not, at any time in the future, seek to enforce any copyright in this +# work against any person or entity, or prevent any person or entity from +# copying, publishing, distributing or creating derivative works of this work. + +use strict; +use warnings; + +use Test::More; + +# Minimum version of Perl required. +my $MINIMUM_VERSION = '5.006'; + +# Skip tests if Test::MinimumVersion is not installed. +if (!eval { require Test::MinimumVersion }) { + plan skip_all => 'Test::MinimumVersion required to test version limits'; +} +Test::MinimumVersion->import; + +# Check most files in the Perl distribution. Note that this doesn't check +# examples or any other random directories with scripts, and there isn't any +# simple way to add more directories. +all_minimum_version_ok($MINIMUM_VERSION, { paths => [glob 'check_*'] });