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
changes/51/6651/4
Guillem Jover 10 years ago
parent 0a560aaeb4
commit 2c900a3673

1
debian/control vendored

@ -5,6 +5,7 @@ Maintainer: Sipwise Development Team <support@sipwise.com>
Build-Depends:
debhelper (>= 8),
libipc-system-simple-perl,
libmodule-build-perl,
libstrictures-perl,
libtrycatch-perl,
Standards-Version: 3.9.7

3
debian/rules vendored

@ -1,6 +1,3 @@
#!/usr/bin/make -f
%:
dh $@
override_dh_auto_test:
echo "FIXME / TODO - skipping dh_auto_test while it is failing"

@ -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';

Loading…
Cancel
Save