.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Test::Signature 3pm" .TH Test::Signature 3pm "2015-05-14" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Test::Signature \- Automated SIGNATURE testing .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& # This is actually the t/0\-signature.t file from this distribution. \& use Test::More tests => 1; \& use Test::Signature; \& \& signature_ok(); .Ve .SH "ABSTRACT" .IX Header "ABSTRACT" \&\f(CW\*(C`Test::Signature\*(C'\fR verifies that the \f(CW\*(C`Module::Signature\*(C'\fR generated signature of a module is correct. .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\f(CW\*(C`Module::Signature\*(C'\fR allows you to verify that a distribution has not been tampered with. \f(CW\*(C`Test::Signature\*(C'\fR lets that be tested as part of the distribution's test suite. .PP By default, if \f(CW\*(C`Module::Signature\*(C'\fR is not installed then it will just say so and not fail the test. That can be overridden though. .PP \&\fB\s-1IMPORTANT\s0\fR: This is not a substitute for the users verifying the distribution themselves. By the time this module is run, the users will have already run your \fIMakefile.PL\fR or \fIBuild.PL\fR scripts which could have been compromised. .PP This module is more for ensuring you've updated your signature appropriately before distributing, and for preventing accidental errors during transmission or packaging. .SH "FUNCTIONS" .IX Header "FUNCTIONS" \&\f(CW\*(C`signature_ok\*(C'\fR is exported by default. \f(CW\*(C`signature_force_ok\*(C'\fR must be explicitly exported. .SS "\fIsignature_ok()\fP" .IX Subsection "signature_ok()" This will test that the \f(CW\*(C`Module::Signature\*(C'\fR generated signature is valid for the distribution. It can be given two optional parameters. The first is a name for the test. The default is \f(CW\*(C`Valid signature\*(C'\fR. The second is whether a lack of \f(CW\*(C`Module::Signature\*(C'\fR should be regarded as a failure. The default is \f(CW0\fR meaning 'no'. .PP .Vb 8 \& # Test with defaults \& signature_ok() \& # Test with custom name \& signature_ok( "Is the signature valid?" ); \& # Test with custom name and force C to exist \& signature_ok( "Is the signature valid?", 1 ); \& # Test without custom name, but forcing \& signature_ok( undef, 1 ); .Ve .SS "\fIsignature_force_ok()\fP" .IX Subsection "signature_force_ok()" This is equivalent to calling \f(CW\*(C`signature_ok( $name, 1 )\*(C'\fR but is more readable. .PP .Vb 3 \& # These are equivalent: \& signature_force_ok( "Is our signature valid?" ); \& signature_ok( "Is our signature valid?", 1); \& \& # These are equivalent: \& signature_force_ok(); \& signature_ok( undef, 1 ); .Ve .SH "NOTES ON USE" .IX Header "NOTES ON USE" .SS "\fI\s-1MANIFEST\s0\fP and \fI\s-1MANIFEST\s0.SKIP\fP" .IX Subsection "MANIFEST and MANIFEST.SKIP" It is \fBimperative\fR that your \fI\s-1MANIFEST\s0\fR and \fI\s-1MANIFEST\s0.SKIP\fR files be accurate and complete. If you are using \f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR and you do not have a \fI\s-1MANIFEST\s0.SKIP\fR file, then don't worry about the rest of this. If you do have a \fI\s-1MANIFEST\s0.SKIP\fR file, or you use \&\f(CW\*(C`Module::Build\*(C'\fR, you must read this. .PP Since the test is run at \f(CW\*(C`make test\*(C'\fR time, the distribution has been made. Thus your \fI\s-1MANIFEST\s0.SKIP\fR file should have the entries listed below. .PP If you're using \f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR, you should have, at least: .PP .Vb 5 \& #defaults \& ^Makefile$ \& ^blib/ \& ^blibdirs$ \& ^pm_to_blib$ .Ve .PP These entries are part of the default set provided by \&\f(CW\*(C`ExtUtils::Manifest\*(C'\fR, which is ignored if you provide your own \&\fI\s-1MANIFEST\s0.SKIP\fR file. .PP If you are using \f(CW\*(C`Module::Build\*(C'\fR, there is no default \fI\s-1MANIFEST\s0.SKIP\fR so you \fBmust\fR provide your own. It must, minimally, contain: .PP .Vb 4 \& ^Build$ \& ^Makefile$ \& ^_build/ \& ^blib/ .Ve .PP If you don't have the correct entries, \f(CW\*(C`Module::Signature\*(C'\fR will complain that you have: .PP .Vb 1 \& ==> MISMATCHED content between MANIFEST and distribution files! <== .Ve .PP You should note this during normal development testing anyway. .SS "Use with Test::Prereq" .IX Subsection "Use with Test::Prereq" \&\f(CW\*(C`Test::Prereq\*(C'\fR tends to get a bit particular about modules. If you're using the \fIforce\fR option with \f(CW\*(C`Test::Signature\*(C'\fR then you will have to specify that you expect \f(CW\*(C`Module::Signature\*(C'\fR as a prerequisite. \f(CW\*(C`Test::Signature\*(C'\fR will not have it as a prerequisite since that would defeat the point of having the \fIforce\fR variant. .PP If you are using \f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR you should have a line like the following in your \fIMakefile.PL\fR: .PP .Vb 5 \& \*(AqPREREQ_PM\*(Aq => { \& \*(AqTest::Signature\*(Aq => \*(Aq1.04\*(Aq, \& \*(AqModule::Signature\*(Aq => \*(Aq0.22\*(Aq, \& \*(AqTest::More\*(Aq => \*(Aq0.47\*(Aq, \& }, .Ve .PP If using \f(CW\*(C`Module::Build\*(C'\fR, your \fIBuild.PL\fR should have: .PP .Vb 5 \& build_requires => { \& \*(AqTest::Signature\*(Aq => \*(Aq1.04\*(Aq, \& \*(AqModule::Signature\*(Aq => \*(Aq0.22\*(Aq, \& \*(AqTest::More\*(Aq => \*(Aq0.47\*(Aq, \& }, .Ve .PP If you just want the default behaviour of testing the signature if and only if the user already has \f(CW\*(C`Module::Signature\*(C'\fR installed, then you will need something like the following code. The example uses \&\f(CW\*(C`Module::Build\*(C'\fR format but it should be trivial for you to translate to \&\f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR. .PP .Vb 3 \& #!/usr/bin/perl \-w \& use strict; \& use Module::Build 0.18; \& \& my @extra_build; \& \& eval { require Module::Signature }; \& if (!$@ or $Test::Prereq::VERSION) \& { \& push @extra_build, "Module::Signature" => \*(Aq0.22\*(Aq \& } \& \& my $m = Module::Build\->new( \& dist_name => \*(AqWWW\-Yahoo\-Groups\*(Aq, \& dist_version => \*(Aq1.7.7\*(Aq, \& license => \*(Aqperl\*(Aq, \& \& requires => { \& # various modules \& \*(Aqperl\*(Aq => \*(Aq5.6.0\*(Aq, \& }, \& build_requires => { \& \*(AqTest::More\*(Aq => 0.47, \& \*(AqTest::Prereq\*(Aq => 0.19, \& \*(AqTest::Prereq::Build\*(Aq => 0.04, \& \*(AqTest::Signature\*(Aq => 1.04, \& @extra_build, \& }, \& ); \& \& $m\->create_build_script; .Ve .PP If you have any questions on using this module with \f(CW\*(C`Test::Prereq\*(C'\fR, just email me (address below). .SS "Use with Module::Install" .IX Subsection "Use with Module::Install" \&\f(CW\*(C`Module::Install\*(C'\fR is a module to assist in the bundling of build prerequisite modules in packages. Well, among other things. .PP \&\f(CW\*(C`Test::Signature\*(C'\fR is a perfect candidate for such a module. As it's a module aimed purely at those writing modules rather than those using them. .PP Here's a good way to use it: .PP Make a test file (say, \fIt/00sig.t\fR) that contains the following: .PP .Vb 4 \& use lib \*(Aqinc\*(Aq; \& use Test::More tests => 1; \& use Test::Signature; \& signature_ok(); .Ve .PP In your \fIMakefile.PL\fR (or \fIBuild.PL\fR if appropriate) add: .PP .Vb 1 \& include \*(AqTest::Signature\*(Aq; .Ve .PP And that's it! You don't have to specify it as a prerequisite or anything like that because \f(CW\*(C`Module::Install\*(C'\fR will include it in your distribution. And you don't have to worry about size because \&\f(CW\*(C`Module::Install\*(C'\fR strips out all this waffling \s-1POD\s0. .SH "THANKS" .IX Header "THANKS" Arthur Bergman for suggesting the module. .PP Audrey Tang for writing Module::Signature, and making some suggestions. .PP Tels suggested testing network connectivity to Audrey; Audrey added that to \f(CW\*(C`Module::Signature\*(C'\fR 0.16 and I (Iain Truskett) added it to this module (as of 1.03). .SH "BUGS" .IX Header "BUGS" Please report bugs at or via the web interface at .SH "AUTHORS" .IX Header "AUTHORS" Audrey Tang Original author: Iain Truskett , now passed away. .SH "LICENSE AND COPYRIGHT" .IX Header "LICENSE AND COPYRIGHT" Copyright 2002, 2003 by Iain Truskett. Copyright 2003, 2007 by Audrey Tang . .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" perl, Module::Signature, Test::More. .PP Module::Build, ExtUtils::Manifest, ExtUtils::MakeMaker. .PP Test::Prereq, Module::Install.