Browse Source

test: Add new minimum perl version unit test

Verify that the perl version we want to restrict ourselves in the coding
style is enforced through the test suite.
Guillem Jover 7 years ago
parent
commit
fdb17ae55a
4 changed files with 35 additions and 0 deletions
  1. 1 0
      Makefile.am
  2. 1 0
      README
  3. 1 0
      debian/changelog
  4. 32 0
      t/minimum-version.t

+ 1 - 0
Makefile.am

@@ -146,6 +146,7 @@ endif
 test_scripts = \
 	t/pod.t \
 	t/pod-spell.t \
+	t/minimum-version.t \
 	t/syntax.t \
 	t/strict.t \
 	t/critic.t \

+ 1 - 0
README

@@ -75,6 +75,7 @@ To enable optional functionality or programs, this software might be needed:
 To run the test suite («make check»):
 
   IO-String perl module
+  Test::MinimumVersion perl module (optional author)
   Test::Pod perl module (optional)
   Test::Spelling perl module (optional, author)
   Test::Strict perl module (optional)

+ 1 - 0
debian/changelog

@@ -78,6 +78,7 @@ dpkg (1.18.8) UNRELEASED; urgency=medium
     - Add new pod-spell unit test.
     - Refactor common unit test checks for needed things into Test::Dpkg.
     - Accept perl's Lancaster Consensus AUTHOR_TESTING variable.
+    - Add new minimum perl version unit test.
   * Documentation:
     - Improve dpkg-buildpackage(1) on environment expectations.
     - Clarify the format of the db:Status-Abbrev virtual field in

+ 32 - 0
t/minimum-version.t

@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Dpkg qw(:needs);
+
+test_needs_author();
+test_needs_module('Test::MinimumVersion');
+test_needs_srcdir_switch();
+
+my @files = Test::Dpkg::all_perl_files();
+
+plan tests => scalar @files;
+
+for my $file (@files) {
+    minimum_version_ok($file, '5.14.2');
+}