The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::Alien::Build - Tools for testing Alien::Build + alienfile

VERSION

version 0.66

SYNOPSIS

 use Test2::V0;
 use Test::Alien::Build;
 
 # returns an instance of Alien::Build.
 my $build = alienfile_ok q{
   use alienfile;
   
   plugin 'My::Plugin' => (
     foo => 1,
     bar => 'string',
     ...
   );
 };
 
 done_testing;

DESCRIPTION

This module provides some tools for testing Alien::Build and alienfile. Outside of Alien::Build core development, It is probably most useful for Alien::Build::Plugin developers.

This module also unsets a number of Alien::Build specific environment variables, in order to make tests reproducible even when overrides are set in different environments. So if you want to test those variables in various states you should explicitly set them in your test script. These variables are unset if they defined: ALIEN_BUILD_PRELOAD ALIEN_BUILD_POSTLOAD ALIEN_INSTALL_TYPE.

FUNCTIONS

alienfile

 my $build = alienfile;
 my $build = alienfile q{ use alienfile ... };
 my $build = alienfile filename => 'alienfile';

Create a Alien::Build instance from the given alienfile. The first two forms are abbreviations.

 my $build = alienfile;
 # is the same as
 my $build = alienfile filename => 'alienfile';

and

 my $build = alienfile q{ use alienfile ... };
 # is the same as
 my $build = alienfile source => q{ use alienfile ... };

Except for the second abbreviated form sets the line number before feeding the source into Alien::Build so that you will get diagnostics with the correct line numbers.

source

The source for the alienfile as a string. You must specify one of source or filename.

filename

The filename for the alienfile. You must specify one of source or filename.

root

The build root.

stage

The staging area for the build.

prefix

The install prefix for the build.

alienfile_ok

 my $build = alienfile_ok;
 my $build = alienfile_ok q{ use alienfile ... };
 my $build = alienfile_ok filename => 'alienfile';

Same as alienfile above, except that it runs as a test, and will not throw an exception on failure (it will return undef instead).

SEE ALSO

Alien
alienfile
Alien::Build
Test::Alien

AUTHOR

Author: Graham Ollis <plicease@cpan.org>

Contributors:

Diab Jerius (DJERIUS)

Roy Storey

Ilya Pavlov

COPYRIGHT AND LICENSE

This software is copyright (c) 2017 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.