[dpkg] 116/187: scripts/t: Skip the tests if IO::String is not present

Reiner Herrmann reiner at reiner-h.de
Sun Nov 6 12:46:31 UTC 2016


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

deki-guest pushed a commit to branch master
in repository dpkg.

commit 4f12a3b01b6e2bdcaf03e9f9b45d8bea7355ebcd
Author: Guillem Jover <guillem at debian.org>
Date:   Sun Aug 28 17:05:24 2016 +0200

    scripts/t: Skip the tests if IO::String is not present
    
    This makes this dependency optional.
---
 README                   | 2 +-
 debian/changelog         | 1 +
 scripts/t/Dpkg_Control.t | 9 ++++++---
 scripts/t/Dpkg_Shlibs.t  | 8 ++++++--
 4 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/README b/README
index a6bb915..c9a41ae 100644
--- a/README
+++ b/README
@@ -75,7 +75,7 @@ To enable optional functionality or programs, this software might be needed:
 
 To run the test suite («make check»):
 
-  IO-String perl module
+  IO-String perl module (optional)
   Test::MinimumVersion perl module (optional author)
   Test::Pod perl module (optional)
   Test::Spelling perl module (optional, author)
diff --git a/debian/changelog b/debian/changelog
index bd4658d..9455a57 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -136,6 +136,7 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
     - Add new dpkg-source functional tests.
     - Add new dpkg-buildpackage functional tests.
     - Add an initial functional test suite for dpkg-deb and dpkg-split.
+    - Skip the involved tests if IO::String is missing.
   * Build system:
     - Add support for profiling perl modules.
     - Clean up compiler and linker automatic flag usage in configure.
diff --git a/scripts/t/Dpkg_Control.t b/scripts/t/Dpkg_Control.t
index e8089fb..5fbb878 100644
--- a/scripts/t/Dpkg_Control.t
+++ b/scripts/t/Dpkg_Control.t
@@ -16,11 +16,14 @@
 use strict;
 use warnings;
 
-use Test::More tests => 24;
-
-use IO::String;
+use Test::More;
+use Test::Dpkg qw(:needs);
 
 BEGIN {
+    test_needs_module('IO::String');
+
+    plan tests => 24;
+
     use_ok('Dpkg::Control');
     use_ok('Dpkg::Control::Info');
 }
diff --git a/scripts/t/Dpkg_Shlibs.t b/scripts/t/Dpkg_Shlibs.t
index c137c48..2e68f74 100644
--- a/scripts/t/Dpkg_Shlibs.t
+++ b/scripts/t/Dpkg_Shlibs.t
@@ -16,10 +16,14 @@
 use strict;
 use warnings;
 
-use Test::More tests => 148;
+use Test::More;
+use Test::Dpkg qw(:needs);
 
 use Cwd;
-use IO::String;
+
+test_needs_module('IO::String');
+
+plan tests => 148;
 
 use Dpkg::Path qw(find_command);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list