File: 3-verify.t

package info (click to toggle)
libmodule-signature-perl 0.93-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 372 kB
  • sloc: perl: 829; makefile: 6
file content (29 lines) | stat: -rw-r--r-- 744 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!perl

use strict;
use File::Spec;
use Test::More;
use IPC::Run qw(run);

if (eval { require Crypt::OpenPGP; 1 }) {
    plan skip_all => "GnuPG only tests";
    exit 0;
}

plan tests => 6;

$|=1;
sub _f ($) {File::Spec->catfile(split /\//, shift);}
0 == system $^X, _f"t/wrap.pl", "-x" or die;
for my $tdir (glob("t/test-dat*")) {
    chdir $tdir or die;
    my @system = ($^X, "-I../../lib/", "../../script/cpansign", "-v");
    my($in,$out,$err);
    run \@system, \$in, \$out, \$err;
    my $ret = $?;
    close $out;
    my $diff = join "\n", grep /^.SHA\d/, split /\n/, $out;
    $err =~ s/Old SIGNATURE detected.*newer\.//;
    ok(0==$ret, "dir[$tdir]system[@system]ret[$ret]out[$out]err[$err]diff[$diff]");
    chdir "../../" or die;
}