Unverified Commit b7b07072 authored by IKEDA Soji's avatar IKEDA Soji Committed by GitHub
Browse files

Merge pull request #870 from ikedas/issue-867 by ikedas

Adding tests for #868
parents dced686e ef6ffefe
......@@ -13,7 +13,7 @@
- ./configure
- cd src; make; cd ..
- make check-local TEST_FILES='xt/perltidy.t' || true
- make check-local TEST_FILES='t/compile_executables.t t/compile_modules.t t/Language.t t/Message.t t/compile_scenarios.t t/parse_templates.t t/pod-syntax.t'
- make check-local TEST_FILES='t/compile_executables.t t/compile_modules.t t/Language.t t/Message.t t/Message_smime.t t/compile_scenarios.t t/parse_templates.t t/pod-syntax.t'
- coverage-report
- make clean
......
......@@ -39,7 +39,7 @@ script:
- ./configure
- cd src; make; cd ..
- make check-local TEST_FILES='xt/perltidy.t' || true
- make check-local TEST_FILES='t/compile_executables.t t/compile_modules.t t/Language.t t/Message.t t/compile_scenarios.t t/parse_templates.t t/pod-syntax.t'
- make check-local TEST_FILES='t/compile_executables.t t/compile_modules.t t/Language.t t/Message.t t/Message_smime.t t/compile_scenarios.t t/parse_templates.t t/pod-syntax.t'
after_success:
- coverage-report
......
......@@ -31,6 +31,7 @@ check_SCRIPTS = \
t/Language.t \
t/LockedFile.t \
t/Message.t \
t/Message_smime.t \
t/Regexps.t \
t/compile_modules.t \
t/compile_executables.t \
......@@ -69,6 +70,8 @@ check_DATA = \
t/data/sympa.conf \
t/data/sympa.sqlite \
t/data/etc/auth.conf \
t/samples/signed.eml \
t/samples/unsigned.eml \
xt/perlcriticrc
noinst_SCRIPTS = \
xt/critic.t \
......
# -*- indent-tabs-mode: nil; -*-
# vim:ft=perl:et:sw=4
# $Id$
use strict;
use warnings;
use English qw(-no_match_vars);
use Test::More;
use Sympa::Log;
use Sympa::Message;
%Conf::Conf = (
sender_headers => 'From',
);
Sympa::Log->instance->{log_to_stderr} = 'err';
# ToDo: smime_encrypt()
# ToDo: smime_decrypt()
# ToDo: smime_sign()
# ToDo: check_smime_signature()
# is_signed()
is test_is_signed('t/samples/unsigned.eml'), 0, 'never signed';
is test_is_signed('t/samples/signed.eml'), 1, 'multipart/signed S/MIME';
#is test_is_signed('t/samples/signed-pkcs7.eml'), 1, 'PKCS#7 S/MIME';
#is test_is_signed('t/samples/signed-pgp.eml'), 0, 'multipart/signed PGP/MIME';
#is test_is_signed('t/samples/signed-pgp-inline.eml'), 0, 'PGP inline';
done_testing();
sub test_is_signed {
my $path = shift;
open my $fh, '<', $path or die $ERRNO;
my $str = do { local $RS; <$fh> };
close $fh;
my $message = Sympa::Message->new($str, context => '*');
return $message->is_signed;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment