Test::AutoBuild::Lib - A library of useful routines
use Test::AutoBuild::Lib; my \@sorted_modules = Test::AutoBuild::Lib::sort_modules(\@modules); my \%packages = Test::AutoBuild::Lib::package_snapshot($package_types); my \%newpackages = Test::AutoBuild::Lib::new_packages(\%before, \%after); my $string = Test::AutoBuild::Lib::pretty_size($bytes); my $string = Test::AutoBuild::Lib::pretty_date($seconds); my $string = Test::AutoBuild::Lib::pretty_time($seconds);
The Test::AutoBuild::Lib module provides a library of routines that are shared across many different modules.
Compares the sets of packages defined by the before and after package snapshots. The returned hash ref will have entries for any files in after, but not in before, or any files which were modified between before and after snapshots.
before
after
Formats the time specified in the seconds parameter to follow the style "Wed Jan 14 2004 21:45:23 UTC".
seconds
Formats an interval in seconds for friendly viewing according to the style "2h 27m 12s" - ie 2 hours, 27 minutes and 12 seconds.
Formats the size specified in the bytes parameter for friendly viewing. If the number of bytes is > 1024x1024 then it formats in MB, with 2 decimal places. Else if the number of bytes is > 1024 it formats in kb with 2 decimal places. Otherwise it just formats as bytes.
bytes
Executes the program specified in the command argument. The returned value is the output of the commands standard output stream. Prior to running the command, the environment variables specified in the env parameter are set. This environment is modified locally, so the changes are only in effect for the duration of this method.
command
env
This method loads the content of the configuration file $file, passes it through the Template module, and then creates an instance of the Config::Record module. The second optiona %vars parameter is a hash reference containing a set of variables which will be passed through to the templating engine. A 3 element list is returned, the first element containing the Config::Record object, the second a scalar containing the post-processed configuration file, the last containing any error message generated.
$file
%vars
Daniel Berrange <dan@berrange.com>, Dennis Gregorovic <dgregorovic@alum.mit.edu>
Copyright (C) 2002-2005 Daniel Berrange <dan@berrange.com>
perl(1), Test::AutoBuild, Test::AutoBuild::Runtime, Template, Config::Record
perl(1)
To install Test::AutoBuild, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::AutoBuild
CPAN shell
perl -MCPAN -e shell install Test::AutoBuild
For more information on module installation, please visit the detailed CPAN module installation guide.