NAME
Test::AutoBuild::Lib - a library of useful routines
SYNOPSIS
use Test::AutoBuild::Lib;
my \@groups = Test::AutoBuild::Lib::load_groups($config);
my \@repositories = Test::AutoBuild::Lib::load_repositories($config);
my \@outputs = Test::AutoBuild::Lib::load_outputs($config);
my \@modules = Test::AutoBuild::Lib::load_modules($config);
my \@package_types = Test::AutoBuild::Lib::load_package_types($config);
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);
my
DESCRIPTION
The Test::AutoBuild::Lib module provides a library of routines that are shared across many different modules.
METHODS
my \@groups = Test::AutoBuild::Lib::load_groups($config);
Loads the groups defined in the configuration object config
. The config object is an instance of the Config::Record
class. The elements in the returned array reference are instances of the Test::AutoBuild::Group class.
my \@repositories = Test::AutoBuild::Lib::load_repositories($config);
Loads the repositories defined in the configuration object config
. The config object is an instance of the Config::Record
class. The elements in the returned array reference are instances of the Test::AutoBuild::Repository class.
my \@outputs = Test::AutoBuild::Lib::load_outputs($config);
Loads the outputs defined in the configuration object config
. The config object is an instance of the Config::Record
class. The elements in the returned array reference are instances of the Test::AutoBuild::Output class.
my \@package_types = Test::AutoBuild::Lib::load_package_types($config);
Loads the package_types defined in the configuration object config
. The config object is an instance of the Config::Record
class. The elements in the returned array reference are instances of the Test::AutoBuild::PackageType class.
my \@modules = Test::AutoBuild::Lib::load_modules($config);
Loads the modules defined in the configuration object config
. The config object is an instance of the Config::Record
class. The elements in the returned array reference are instances of the Test::AutoBuild::Module class.
my \@sorted_modules = Test::AutoBuild::Lib::sort_modules(\@modules);
Performs a topological sort of modules based on their declared build dependancies. The elements in the modules
parameter should be instances of Test::AutoBuild::Module class. The returned array ref will be in sorted order.
my \%packages = Test::AutoBuild::Lib::package_snapshot(\@pacakge_types);
Takes a snapshot all packages on disk for each package type. The elements in the package_types
parameter should be instances of Test::AutoBuild::PackageType. The keys in the returned hash ref will be the fully qualified filenames of the packages, while the values will be instances of Test::AutoBuild::Package class.
my %packages = Test::AutoBuild::Lib::new_packages(\%before, \%after);
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.
my $string = Test::AutoBuild::Lib::pretty_date($seconds);
Formats the time specified in the seconds
parameter to follow the style "Wed Jan 14 2004 21:45:23 UTC".
my $string = Test::AutoBuild::Lib::pretty_time($seconds);
Formats an interval in seconds for friendly viewing according to the style "2h 27m 12s" - ie 2 hours, 27 minutes and 12 seconds.
my $string = Test::AutoBuild::Lib::pretty_size($bytes);
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.
my $output = Test::AutoBuild::Lib::run($command, \%env);
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.
AUTHORS
Daniel Berrange <dan@berrange.com>, Dennis Gregorovic <dgregorovic@alum.mit.edu>
COPYRIGHT
Copyright (C) 2002-2004 Daniel Berrange <dan@berrange.com>
SEE ALSO
2 POD Errors
The following errors were encountered while parsing the POD:
- Around line 57:
You can't have =items (as at line 76) unless the first thing after the =over is an =item
- Around line 565:
=back doesn't take any parameters, but you said =back 4