summaryrefslogtreecommitdiff
path: root/t/strict.t
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2016-06-16 19:56:24 +0200
committerGuillem Jover <guillem@debian.org>2016-07-03 21:02:23 +0200
commit6278c8e98fee08f8ce0c2dc17a07a28d31eb3584 (patch)
treec8e53a7d8620f8ea5f6e4d10929b6518c9ddf6fc /t/strict.t
parentecc297ebf559226122516dc129718d8814cffb4e (diff)
downloaddpkg-6278c8e98fee08f8ce0c2dc17a07a28d31eb3584.tar.gz
test: Refactor common unit test checks for needed things
Diffstat (limited to 't/strict.t')
-rw-r--r--t/strict.t13
1 files changed, 4 insertions, 9 deletions
diff --git a/t/strict.t b/t/strict.t
index 183d9a363..62c792fff 100644
--- a/t/strict.t
+++ b/t/strict.t
@@ -17,17 +17,12 @@ use strict;
use warnings;
use Test::More;
-use Test::Dpkg;
+use Test::Dpkg qw(:needs);
-eval q{
- use Test::Strict;
- $Test::Strict::TEST_WARNINGS = 1;
-};
-plan skip_all => 'Test::Strict required for testing syntax' if $@;
+test_needs_module('Test::Strict');
+test_needs_srcdir_switch();
-if (defined $ENV{srcdir}) {
- chdir $ENV{srcdir} or die "cannot chdir to source directory: $!";
-}
+eval '$Test::Strict::TEST_WARNINGS = 1';
my @files = Test::Dpkg::all_perl_files();