
Test::AutoBuild::Lib - A library of useful routines

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

The Test::AutoBuild::Lib module provides a library of routines that are shared across many different modules.

my \@groups = Test::AutoBuild::Lib::load_groups($config);
Loads the groups defined in the configuration object
config. The config object is an instance of theConfig::Recordclass. The elements in the returned array reference are instances of the Test::AutoBuild::Group class.my \@publishers = Test::AutoBuild::Lib::load_publishers($config);
Loads the artifact publishing modules defined in the configuration object
config. The config object is an instance of theConfig::Recordclass. The elements in the returned array reference are instances of a subclass of Test::AutoBuild::Publisher.my \@repositories = Test::AutoBuild::Lib::load_repositories($config);
Loads the repositories defined in the configuration object
config. The config object is an instance of theConfig::Recordclass. 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 theConfig::Recordclass. 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 theConfig::Recordclass. 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 theConfig::Recordclass. 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
modulesparameter 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_typesparameter 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
beforeandafterpackage snapshots. The returned hash ref will have entries for any files inafter, but not inbefore, or any files which were modified betweenbeforeandaftersnapshots.my $string = Test::AutoBuild::Lib::pretty_date($seconds);
Formats the time specified in the
secondsparameter 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
bytesparameter 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
commandargument. The returned value is the output of the commands standard output stream. Prior to running the command, the environment variables specified in theenvparameter are set. This environment is modified locally, so the changes are only in effect for the duration of this method.

Daniel Berrange <dan@berrange.com>, Dennis Gregorovic <dgregorovic@alum.mit.edu>

Copyright (C) 2002-2004 Daniel Berrange <dan@berrange.com>
