[libbusiness-isbn-data-perl] 01/02: Fix autopkgtest failures with a small patch to support as-installed testing.
Niko Tyni
ntyni at moszumanska.debian.org
Tue Oct 14 17:03:33 UTC 2014
This is an automated email from the git hooks/post-receive script.
ntyni pushed a commit to branch master
in repository libbusiness-isbn-data-perl.
commit 997e7cbb3988c0b27cffec9234856e154d5a9f80
Author: Niko Tyni <ntyni at debian.org>
Date: Tue Oct 14 19:54:30 2014 +0300
Fix autopkgtest failures with a small patch to support as-installed testing.
Closes: #765167
---
...st-suite-support-Debian-as-installed-test.patch | 53 ++++++++++++++++++++++
debian/patches/series | 1 +
debian/tests/pkg-perl/test-files | 2 +
3 files changed, 56 insertions(+)
diff --git a/debian/patches/0001-Make-the-test-suite-support-Debian-as-installed-test.patch b/debian/patches/0001-Make-the-test-suite-support-Debian-as-installed-test.patch
new file mode 100644
index 0000000..89a67f4
--- /dev/null
+++ b/debian/patches/0001-Make-the-test-suite-support-Debian-as-installed-test.patch
@@ -0,0 +1,53 @@
+From 7a98112d248336093267ed69c6f361d2710c1fc3 Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni at debian.org>
+Date: Tue, 14 Oct 2014 19:42:18 +0300
+Subject: [PATCH] Make the test suite support Debian as-installed testing
+ ("autopkgtest")
+
+When running as-installed tests, the module gets loaded from the system
+paths. As-installed testing is detected by the existence of the ADTTMP
+environment variable.
+
+Bug-Debian: https://bugs.debian.org/765167
+Forwarded: not-needed
+---
+ t/check_data_structure.t | 9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/t/check_data_structure.t b/t/check_data_structure.t
+index 021d389..a4af6af 100644
+--- a/t/check_data_structure.t
++++ b/t/check_data_structure.t
+@@ -3,6 +3,7 @@
+ use Test::More 0.95;
+
+ use File::Spec::Functions qw(catfile);
++use Config;
+
+ subtest 'setup' => sub {
+ use_ok( 'Business::ISBN::Data' );
+@@ -12,7 +13,9 @@ subtest 'setup' => sub {
+ subtest 'current_data' => sub {
+ # Test with included RangeMessage.xml in the same spot as the module
+ like( $Business::ISBN::country_data{_source}, qr/RangeMessage\.xml/ );
+- like( $Business::ISBN::country_data{_source}, qr/blib/ );
++ like( $Business::ISBN::country_data{_source},
++ # support Debian runtime testing ("autopkgtest")
++ $ENV{ADTTMP} ? qr/\Q$Config{vendorlib}/ : qr/blib/);
+ foreach my $key ( sort { $a <=> $b } grep { ! /\A_/ } keys %Business::ISBN::country_data )
+ {
+ my $value = $Business::ISBN::country_data{$key};
+@@ -31,7 +34,9 @@ subtest 'current_data' => sub {
+ local $ENV{ISBN_RANGE_MESSAGE} = catfile( qw(lib Business ISBN RangeMessage.xml) );
+ local %Business::ISBN::country_data = Business::ISBN::Data::_get_data();
+ ok( -e $ENV{ISBN_RANGE_MESSAGE}, 'Alternate RangeMessage.xml exists' );
+- unlike( $Business::ISBN::country_data{_source}, qr/blib/ );
++ unlike( $Business::ISBN::country_data{_source},
++ # support Debian runtime testing ("autopkgtest")
++ $ENV{ADTTMP} ? qr/\Q$Config{vendorlib}/ : qr/blib/);
+ like( $Business::ISBN::country_data{_source}, qr/RangeMessage\.xml/ );
+ foreach my $key ( sort { $a <=> $b } grep { ! /\A_/ } keys %Business::ISBN::country_data )
+ {
+--
+2.1.1
+
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..669c292
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Make-the-test-suite-support-Debian-as-installed-test.patch
diff --git a/debian/tests/pkg-perl/test-files b/debian/tests/pkg-perl/test-files
new file mode 100644
index 0000000..4b89ce2
--- /dev/null
+++ b/debian/tests/pkg-perl/test-files
@@ -0,0 +1,2 @@
+t
+lib/Business/ISBN/RangeMessage.xml
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libbusiness-isbn-data-perl.git
More information about the Pkg-perl-cvs-commits
mailing list