File: //usr/local/share/man/man3/Alien::Build::Plugin::Test::Mock.3pm
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
.\"
.\" 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" ''
. ds C`
. ds C'
'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 >0, 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.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
. if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{\
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "Alien::Build::Plugin::Test::Mock 3"
.TH Alien::Build::Plugin::Test::Mock 3 "2021-10-28" "perl v5.26.3" "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"
Alien::Build::Plugin::Test::Mock \- Mock plugin for testing
.SH "VERSION"
.IX Header "VERSION"
version 2.45
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 8
\& use alienfile;
\& plugin \*(AqTest::Mock\*(Aq => (
\& probe => \*(Aqshare\*(Aq,
\& download => 1,
\& extract => 1,
\& build => 1,
\& gather => 1,
\& );
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
This plugin is used for testing Alien::Build plugins. Usually you only want to test
one or two phases in an alienfile for your plugin, but you still have to have a fully
formed alienfile that contains all required phases. This plugin lets you fill in the
other phases with the appropriate hooks. This is usually better than using real plugins
which may pull in additional dynamic requirements that you do not want to rely on at
test time.
.SH "PROPERTIES"
.IX Header "PROPERTIES"
.SS "probe"
.IX Subsection "probe"
.Vb 3
\& plugin \*(AqTest::Mock\*(Aq => (
\& probe => $probe,
\& );
.Ve
.PP
Override the probe behavior by one of the following:
.IP "share" 4
.IX Item "share"
For a \f(CW\*(C`share\*(C'\fR build.
.IP "system" 4
.IX Item "system"
For a \f(CW\*(C`system\*(C'\fR build.
.IP "die" 4
.IX Item "die"
To throw an exception in the probe hook. This will usually cause Alien::Build
to try the next probe hook, if available, or to assume a \f(CW\*(C`share\*(C'\fR install.
.SS "download"
.IX Subsection "download"
.Vb 3
\& plugin \*(AqTest::Mock\*(Aq => (
\& download => \e%fs_spec,
\& );
\&
\& plugin \*(AqTest::Mock\*(Aq => (
\& download => 1,
\& );
.Ve
.PP
Mock out a download. The \f(CW%fs_spec\fR is a hash where the hash values are directories
and the string values are files. This a spec like this:
.PP
.Vb 11
\& plugin \*(AqTest::Mock\*(Aq => (
\& download => {
\& \*(Aqfoo\-1.00\*(Aq => {
\& \*(AqREADME.txt\*(Aq => "something to read",
\& \*(Aqfoo.c\*(Aq => "#include <stdio.h>\en",
\& "int main() {\en",
\& " printf(\e"hello world\e\en\e");\en",
\& "}\en",
\& }
\& },
\& );
.Ve
.PP
Would generate two files in the directory 'foo\-1.00', a \f(CW\*(C`README.txt\*(C'\fR and a C file named \f(CW\*(C`foo.c\*(C'\fR.
The default, if you provide a true non-hash value is to generate a single tarball with the name
\&\f(CW\*(C`foo\-1.00.tar.gz\*(C'\fR.
.SS "extract"
.IX Subsection "extract"
.Vb 3
\& plugin \*(AqTest::Mock\*(Aq => (
\& extract => \e%fs_spec,
\& );
\&
\& plugin \*(AqTest::Mock\*(Aq => (
\& extract => 1,
\& );
.Ve
.PP
Similar to \f(CW\*(C`download\*(C'\fR above, but for the \f(CW\*(C`extract\*(C'\fR phase.
.SS "build"
.IX Subsection "build"
.Vb 3
\& plugin \*(AqTest::Mock\*(Aq => (
\& build => [ \e%fs_spec_build, \e%fs_spec_install ],
\& );
\&
\& plugin \*(AqTest::Mock\*(Aq => (
\& build => 1,
\& );
.Ve
.SS "gather"
.IX Subsection "gather"
.Vb 3
\& plugin \*(AqTest::Mock\*(Aq => (
\& gather => \e%runtime_prop,
\& );
\&
\& plugin \*(AqTest::Mock\*(Aq => (
\& gather => 1,
\& );
.Ve
.PP
This adds a gather hook (for both \f(CW\*(C`share\*(C'\fR and \f(CW\*(C`system\*(C'\fR) that adds the given runtime properties, or
if a true non-hash value is provided, some reasonable runtime properties for testing.
.SH "AUTHOR"
.IX Header "AUTHOR"
Author: Graham Ollis <plicease@cpan.org>
.PP
Contributors:
.PP
Diab Jerius (\s-1DJERIUS\s0)
.PP
Roy Storey (\s-1KIWIROY\s0)
.PP
Ilya Pavlov
.PP
David Mertens (run4flat)
.PP
Mark Nunberg (mordy, mnunberg)
.PP
Christian Walde (Mithaldu)
.PP
Brian Wightman (MidLifeXis)
.PP
Zaki Mughal (zmughal)
.PP
mohawk (mohawk2, \s-1ETJ\s0)
.PP
Vikas N Kumar (vikasnkumar)
.PP
Flavio Poletti (polettix)
.PP
Salvador Fandiño (salva)
.PP
Gianni Ceccarelli (dakkar)
.PP
Pavel Shaydo (zwon, trinitum)
.PP
Kang-min Liu (劉康民, gugod)
.PP
Nicholas Shipp (nshp)
.PP
Juan Julián Merelo Guervós (\s-1JJ\s0)
.PP
Joel Berger (\s-1JBERGER\s0)
.PP
Petr Písař (ppisar)
.PP
Lance Wicks (\s-1LANCEW\s0)
.PP
Ahmad Fatoum (a3f, \s-1ATHREEF\s0)
.PP
José Joaquín Atria (\s-1JJATRIA\s0)
.PP
Duke Leto (\s-1LETO\s0)
.PP
Shoichi Kaji (\s-1SKAJI\s0)
.PP
Shawn Laffan (\s-1SLAFFAN\s0)
.PP
Paul Evans (leonerd, \s-1PEVANS\s0)
.PP
Håkon Hægland (hakonhagland, \s-1HAKONH\s0)
.PP
nick nauwelaerts (\s-1INPHOBIA\s0)
.SH "COPYRIGHT AND LICENSE"
.IX Header "COPYRIGHT AND LICENSE"
This software is copyright (c) 2011\-2020 by Graham Ollis.
.PP
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.