Internal debugging improvements.
[test-reporter.git] / t / 0-signature.t
blobd828bdd98f2b1db06f1cfe11c1a0bc8ef88f385f
1 #!/usr/bin/perl
3 use strict;
4 use Test::More;
6 if (!$ENV{TEST_SIGNATURE}) {
7 plan skip_all =>
8 "Set the environment variable TEST_SIGNATURE to enable this test.";
10 elsif (!eval { require Module::Signature; 1 }) {
11 plan skip_all =>
12 "Next time around, consider installing Module::Signature, ".
13 "so you can verify the integrity of this distribution.";
15 elsif ( !-e 'SIGNATURE' ) {
16 plan skip_all => "SIGNATURE not found";
18 elsif ( -s 'SIGNATURE' == 0 ) {
19 plan skip_all => "SIGNATURE file empty";
21 elsif (!eval { require Socket; Socket::inet_aton('pgp.mit.edu') }) {
22 plan skip_all => "Cannot connect to the keyserver to check module ".
23 "signature";
25 else {
26 plan tests => 1;
29 my $ret = Module::Signature::verify();
30 SKIP: {
31 skip "Module::Signature cannot verify", 1
32 if $ret eq Module::Signature::CANNOT_VERIFY();
34 cmp_ok $ret, '==', Module::Signature::SIGNATURE_OK(), "Valid signature";