Alien::...t::Mock(3)
π Alien::Build::Plugin::Test::Mock β the mock plugin bestie π
okay so this is Alien::Build::Plugin::Test::Mock, from the User Contributed Perl Documentation corner of the universe, and it's literally the plug for testing your Alien::Build plugins. no cap.
β¨ VERSION β¨
version 2.88 π
πΈ SYNOPSIS πΈ
use alienfile;
plugin 'Test::Mock' => (
probe => 'share',
download => 1,
extract => 1,
build => 1,
gather => 1,
);
π¦ DESCRIPTION π¦
So here's the tea, bestie: this plugin exists so you can test Alien::Build plugins. Usually you only wanna test one or two phases in an alienfile for your plugin, but the universe said "no π" and you still have to have a fully formed alienfile with all the required phases in it. Rude, honestly.
This plugin lets you fill in all those other phases with the appropriate hooks. and it's usually better than using real plugins, because real plugins may pull in additional dynamic requirements that you do not want to rely on at test time. not the vibe. π
π 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. π dramatic but valid.
π§ 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. So 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". icon behaviour fr. 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. same energy, different 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. cute, functional, slay. π
π«Ά check_digest
plugin 'Test::Mock' => (
check_digest => 1, # the default
);
This adds a check_digest hook that uses fake algorithm FAKE that hashes everything to "deadbeaf". The mock download above will set the digest for download_details so that this will pass the signature check. π₯
plugin 'Test::Mock' => (
check_digest => sub {
my($build, $file, $algo, $digest) = @_;
...
},
);
If you give it a code reference then you can write your own faux digest. See the check_digest hook in Alien::Build::Manual::PluginAuthor for details. iykyk π
π 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 FandiΓ±o (salva)
- Gianni Ceccarelli (dakkar)
- Pavel Shaydo (zwon, trinitum)
- Kang-min Liu (εεΊ·ζ°, gugod)
- Nicholas Shipp (nshp)
- Juan JuliΓ‘n Merelo GuervΓ³s (JJ)
- Joel Berger (JBERGER)
- Petr PΓsaΕ (ppisar)
- Lance Wicks (LANCEW)
- Ahmad Fatoum (a3f, ATHREEF)
- JosΓ© JoaquΓn Atria (JJATRIA)
- Duke Leto (LETO)
- Shoichi Kaji (SKAJI)
- Shawn Laffan (SLAFFAN)
- Paul Evans (leonerd, PEVANS)
- HΓ₯kon HΓ¦gland (hakonhagland, HAKONH)
- nick nauwelaerts (INPHOBIA)
- Florian Weimer
- Marcel Telka (mtelka)
look at this roster π absolute legends, every single one, no skips. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2011-2022 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. π
and that's the whole page bestie β this was Alien::Build::Plugin::Test::Mock from perl v5.42.3, dated 2026-09-21, and it's from the User Contributed Perl Documentation collection. mwah π
β¨
π¦ where this page comes from
- fedora 43: perl-Alien-Build 2.88-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-Alien-Build 2.88-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms