AnyEvent-GnuPG
view release on metacpan or search on metacpan
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
#use Test;
use strict;
use Test::More;
use Try::Tiny;
use Env::Path;
use constant USERID => "GnuPG Test";
use constant PASSWD => "test";
use constant UNTRUSTED => "Francis";
use AnyEvent::GnuPG;
BEGIN {
$| = 1;
}
my @tests = (
qw(
version
gen_key_test
import_test
import2_test
import3_test
export_test
export2_test
export_secret_test
encrypt_test
pipe_encrypt_test
pipe_decrypt_test
encrypt_sign_test
encrypt_sym_test
encrypt_notrust_test
decrypt_test
decrypt_sign_test
decrypt_sym_test
sign_test
detachsign_test
clearsign_test
verify_sign_test
verify_detachsign_test
verify_clearsign_test
multiple_recipients
)
);
if ( defined $ENV{TESTS} ) {
@tests = split /\s+/, $ENV{TESTS};
}
unless ( Env::Path->PATH->Whence('gpg') ) {
plan skip_all => 'gpg needed for this module';
}
else {
plan tests => scalar @tests;
}
my $gpg = AnyEvent::GnuPG->new( homedir => "test" );
for (@tests) {
subtest $_ => sub {
try {
no strict 'refs'; ## no critic
&$_();
pass;
( run in 2.456 seconds using v1.01-cache-2.11-cpan-6736b670a1e )