Alien::Build::Plugin::Test::Mock - Mock plugin for testing
use alienfile; plugin 'Test::Mock' => ( probe => 'share', download => 1, extract => 1, build => 1, gather => 1, );
User Contributed Perl Documentation Alien::Build::Plugin::Test::Mock(3) NAME Alien::Build::Plugin::Test::Mock - Mock plugin for testing VERSION version 1.89 SYNOPSIS use alienfile; plugin 'Test::Mock' => ( probe => 'share', download => 1, extract => 1, build => 1, gather => 1, ); 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. PROPERTIES probe plugin 'Test::Mock' => ( probe => $probe, ); Override the probe behavior by one of the following: share For a "share" build. system For a "system" build. 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 "share" install. download plugin 'Test::Mock' => ( download => \%fs_spec, ); plugin 'Test::Mock' => ( download => 1, ); Mock out a download. The %fs_spec is a hash where the hash values are directories and the string values are files. This a spec like this: plugin 'Test::Mock' => ( download => { 'foo-1.00' => { 'README.txt' => "something to read", 'foo.c' => "#include <stdio.h>\n", "int main() {\n", " printf(\"hello world\\n\");\n", "}\n", } }, ); Would generate two files in the directory 'foo-1.00', a "README.txt" and a C file named "foo.c". The default, if you provide a true non- hash value is to generate a single tarball with the name "foo-1.00.tar.gz". extract plugin 'Test::Mock' => ( extract => \%fs_spec, ); plugin 'Test::Mock' => ( extract => 1, ); Similar to "download" above, but for the "extract" phase. build plugin 'Test::Mock' => ( build => [ \%fs_spec_build, \%fs_spec_install ], ); plugin 'Test::Mock' => ( build => 1, ); gather plugin 'Test::Mock' => ( gather => \%runtime_prop, ); plugin 'Test::Mock' => ( gather => 1, ); This adds a gather hook (for both "share" and "system") that adds the given runtime properties, or if a true non-hash value is provided, some reasonable runtime properties for testing. AUTHOR Author: Graham Ollis <plicease@cpan.org> Contributors: Diab Jerius (DJERIUS) Roy Storey (KIWIROY) Ilya Pavlov David Mertens (run4flat) Mark Nunberg (mordy, mnunberg) Christian Walde (Mithaldu) Brian Wightman (MidLifeXis) Zaki Mughal (zmughal) mohawk (mohawk2, ETJ) Vikas N Kumar (vikasnkumar) Flavio Poletti (polettix) Salvador Fandio (salva) Gianni Ceccarelli (dakkar) Pavel Shaydo (zwon, trinitum) Kang-min Liu (, gugod) Nicholas Shipp (nshp) Juan Julin Merelo Guervs (JJ) Joel Berger (JBERGER) Petr Pisar (ppisar) Lance Wicks (LANCEW) Ahmad Fatoum (a3f, ATHREEF) Jos Joaqun Atria (JJATRIA) Duke Leto (LETO) Shoichi Kaji (SKAJI) Shawn Laffan (SLAFFAN) Paul Evans (leonerd, PEVANS) COPYRIGHT AND LICENSE This software is copyright (c) 2011-2019 by Graham Ollis. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. ATTRIBUTES See attributes(7) for descriptions of the following attributes: +---------------+--------------------------------+ |ATTRIBUTE TYPE | ATTRIBUTE VALUE | +---------------+--------------------------------+ |Availability | library/perl-5/alien-build-532 | +---------------+--------------------------------+ |Stability | Volatile | +---------------+--------------------------------+ NOTES Source code for open source software components in Oracle Solaris can be found at https://www.oracle.com/downloads/opensource/solaris-source- code-downloads.html. This software was built from source available at https://github.com/oracle/solaris-userland. The original community source was downloaded from http://www.cpan.org/authors/id/P/PL/PLICEASE/Alien-Build-1.89.tar.gz. Further information about this software can be found on the open source community website at http://search.cpan.org/dist/Alien-Build/. perl v5.32.0 2019-09-25 Alien::Build::Plugin::Test::Mock(3)