[license-reconcile] 02/03: Add test to ensure that all version numbers are the same

Axel Beckert abe at deuxchevaux.org
Sat Sep 28 20:56:43 UTC 2013


This is an automated email from the git hooks/post-receive script.

abe pushed a commit to branch master
in repository license-reconcile.

commit 12256524454607fd95cf056de2b3c24a420dc3c2
Author: Axel Beckert <abe at deuxchevaux.org>
Date:   Sat Sep 28 22:21:03 2013 +0200

    Add test to ensure that all version numbers are the same
---
 debian/changelog |    2 ++
 t/version.t      |   28 ++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 1eb3ab6..377a422 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,8 @@ license-reconcile (0.4) UNRELEASED; urgency=low
     version to build-dependency.
   * Adapt t/lib/TestData.pm to Perl 5.18's error messages.
     + Build-Depend-Indep on Perl >= 5.18
+  * Add test to ensure that all version numbers in the modules are the
+    same as in debian/changelog.
 
  -- Axel Beckert <abe at debian.org>  Sat, 28 Sep 2013 18:32:43 +0200
 
diff --git a/t/version.t b/t/version.t
new file mode 100644
index 0000000..aecf859
--- /dev/null
+++ b/t/version.t
@@ -0,0 +1,28 @@
+#!/usr/bin/perl -wl
+
+use Test::More;
+use File::Basename;
+
+my $basedir = dirname($0).'/..';
+
+my $debian_changelog_version = `head -1 $basedir/debian/changelog | awk -F'[ ()]+' '{print \$2}'`;
+chomp($debian_changelog_version);
+
+foreach my $file (map { "$basedir/$_" }
+                  ('lib/Debian/LicenseReconcile.pm',
+                   glob('lib/Debian/LicenseReconcile/*.pm'),
+                   glob('lib/Debian/LicenseReconcile/*/*.pm'))) {
+    my $pm_version = `egrep '^our .VERSION' $file`;
+    eval($pm_version);
+
+    is( $VERSION, $debian_changelog_version,
+        "Version number in debian/changelog and \$VERSION in $file are the same" );
+
+    my $pod_version = `egrep '^Version [0-9]' $file`;
+    my @v = split(/\s+/, $pod_version);
+
+    is( $v[1], $debian_changelog_version,
+        "Version numbers in debian/changelog and POD of $file are the same" );
+}
+
+done_testing;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/license-reconcile.git



More information about the Pkg-perl-cvs-commits mailing list