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.
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.