From 2c900a3673a47183573e3654fa3ef6f5c8b3922c Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Mon, 13 Jun 2016 17:35:55 +0200 Subject: [PATCH] MT#20543 Update and enable test suite - Protect the syntax that we are checking with eval, so that when it is not available we can do proper test suite checks instead of exiting with compilation errors. - Remove check for switch feature, which is considered experimental with latest perl versions and emits warnings. - When testing unlink, use a filename that is very unlikely to exist. - Add libmodule-build-perl to Build-Depends which will be removed from perl's core soon. - Remove dh_auto_test override to enable the test suite. Change-Id: I458f680d4743ec9025ff68c44b867a7e6398fcd6 --- debian/control | 1 + debian/rules | 3 --- t/exports.t | 29 +++++++++++++---------------- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/debian/control b/debian/control index 83ac070..caedae6 100644 --- a/debian/control +++ b/debian/control @@ -5,6 +5,7 @@ Maintainer: Sipwise Development Team Build-Depends: debhelper (>= 8), libipc-system-simple-perl, + libmodule-build-perl, libstrictures-perl, libtrycatch-perl, Standards-Version: 3.9.7 diff --git a/debian/rules b/debian/rules index 54035a5..cbe925d 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,3 @@ #!/usr/bin/make -f %: dh $@ - -override_dh_auto_test: - echo "FIXME / TODO - skipping dh_auto_test while it is failing" diff --git a/t/exports.t b/t/exports.t index fbcf505..f346a8a 100644 --- a/t/exports.t +++ b/t/exports.t @@ -13,26 +13,23 @@ ok $@, 'strict refs'; eval { my $foo = 1 + undef }; ok $@, 'fatal warnings'; -ok say(''), 'say syntax is available'; +eval 'say("")'; +ok !$@, 'say syntax is available'; -ok state $foobar = 1, 'state syntax is available'; +eval 'state $foobar = 1'; +ok !$@, 'state syntax is available'; -eval { - given (1) { - when (1) {} - default {1} - } -}; -ok !$@, 'switch syntax is available'; - -eval { unlink '/tmp/doesnotexist' }; +eval { unlink '/nonexistent' }; ok $@, 'autodie is in effect'; -try { - die bless { fnord => 42 } => 'Foobar'; -} catch (Foobar $e) { - ok $e->isa('Foobar'), 'TryCatch works'; -} +eval q{ + try { + die bless { fnord => 42 } => 'Foobar'; + } catch (Foobar $e) { + $e->isa('Foobar') or die 'TryCatch failed'; + } +}; +ok !$@, 'TryCatch is available and works'; ok uc("\xe4") eq "\xc4", 'unicode_strings in effect';