NAME

Test::BrewBuild - Perl/Berry brew unit testing automation, with remote tester dispatching capabilities.

NOTICE

This is the first devel release that includes the entire remote dispatching/tester server distributed testing environment. Things can and will change in the next couple of weeks, and there are a lot of edge cases that don't have tests yet (so things may not work completely as expected yet). Once I've got a list of requirements sorted, the POD nice and clean, installation confirmed fully working and more testing done, I'll be bumping the version to 2.00

The documentation for the bundled script that does the testing can be found at brewbuild.

For running remote tester servers, see bbtester for the script and Test::BrewBuild::Tester for its API.

For the dispatcher service that distributes test runs to the remote testers, see bbdispatch for the script, and Test::BrewBuild::Dispatch for the API.

DESCRIPTION

This module is the backend for the brewbuild script that is accompanied by this module.

It provides you the ability to perform your unit tests across all of your Perlbrew (Unix) or Berrybrew (Windows) Perl instances.

For Windows, you'll need to install Berrybrew (see "SEE ALSO" for details). For Unix, you'll need Perlbrew.

It allows you to remove and reinstall on each test run, install random versions of perl, or install specific versions.

All unit tests are run against all installed instances.

SYNOPSIS

use Test::BrewBuild;

my $bb = Test::BrewBuild->new;

my @perls_available = $bb->perls_available;
my @perls_installed = $bb->perls_installed;

# remove all currently installed instances of perl, less the one you're
# using

$bb->instance_remove;

# find and test against all the current module's reverse CPAN dependencies

$bb->revdep;

# run standard tests

$bb->test;

METHODS

new(%args)

Returns a new Test::BrewBuild object. See the documentation for the brewbuild script to understand what the arguments are and do.

options(\%args)

Takes a hash reference of the command-line argument list, and converts it into a hash of the translated parameter names with their values.

Returns the converted hash for passing back into new().

config_file

Returns a string that contains the path/filename of the configuration file, if available.

plugin('Module::Name')

Fetches and installs a custom plugin which contains the code that perlbrew/berrybrew exec will execute. If not used or the module specified can't be located (or it contains errors), we fall back to the default bundled Test::BrewBuild::Plugin::DefaultExec (which is the canonical example for writing new plugins).

Note that you can send in a custom plugin *.pm filename to plugin as opposed to a module name if the module isn't installed. If the file isn't in the current working directory, send in the relative or full path.

brew_info

Helper method, returns the appropriate *brew calls relative to the platform we're working on.

perls_available

Returns an array containing all perls available, whether already installed or not.

perls_installed

Returns an array of the names of all perls currently installed under your *brew setup.

instance_install

If 'install' param is set, will install that specific version. If 'new' param is set to a positive integer, will install that many random versions of perl.

instance_remove

Uninstalls all currently installed perls, less the one you are currently 'switch'ed or 'use'd to.

test

Processes and returns the test results as a string scalar.

revdeps

Returns a list of the reverse dependencies (according to CPAN) that the module you're working on in the current working directory have.

revdep

Loops over all of the current module's reverse dependencies, and executes test() on each one at a time. This helps you confirm whether your new build won't break your downstream users' modules.

legacy

By default, we don't install perl versions less than v5.8.0. Pass in a true value to override this default.

setup

Prints out detailed information on setting up a testing environment, on Windows or Unix.

help

Displays the command line usage information.

is_win

Helper method, returns true if the current OS is Windows, false if not.

log

Developer method, returns an instance of the packages log object for creating child log objects.

tempdir

Sets up the object with a temporary directory that will be removed after run.

AUTHOR

Steve Bertrand, <steveb at cpan.org>

CONTRIBUTING

Any and all feedback and help is appreciated. A Pull Request is the preferred method of receiving changes (https://github.com/stevieb9/p5-test-brewbuild), but regular patches through the bug tracker, or even just email discussions are welcomed.

BUGS

https://github.com/stevieb9/p5-test-brewbuild/issues

SUPPORT

You can find documentation for this module and its accompanying script with the perldoc command:

perldoc Test::BrewBuild

perldoc brewbuild

SEE ALSO

Berrybrew for Windows:

https://github.com/dnmfarrell/berrybrew

Perlbrew for Unixes:

http://perlbrew.pl

LICENSE AND COPYRIGHT

Copyright 2016 Steve Bertrand.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.