1Test::AutoBuild::Lib(3)User Contributed Perl DocumentatioTnest::AutoBuild::Lib(3)
2
3
4
6 Test::AutoBuild::Lib - A library of useful routines
7
9 use Test::AutoBuild::Lib;
10
11 my \@sorted_modules = Test::AutoBuild::Lib::sort_modules(\@modules);
12
13 my \%packages = Test::AutoBuild::Lib::package_snapshot($package_types);
14 my \%newpackages = Test::AutoBuild::Lib::new_packages(\%before, \%after);
15
16 my $string = Test::AutoBuild::Lib::pretty_size($bytes);
17 my $string = Test::AutoBuild::Lib::pretty_date($seconds);
18 my $string = Test::AutoBuild::Lib::pretty_time($seconds);
19
21 The Test::AutoBuild::Lib module provides a library of routines that are
22 shared across many different modules.
23
25 my %packages = Test::AutoBuild::Lib::new_packages(\%before, \%after);
26 Compares the sets of packages defined by the "before" and "after"
27 package snapshots. The returned hash ref will have entries for any
28 files in "after", but not in "before", or any files which were
29 modified between "before" and "after" snapshots.
30
31 my $string = Test::AutoBuild::Lib::pretty_date($seconds);
32 Formats the time specified in the "seconds" parameter to follow the
33 style "Wed Jan 14 2004 21:45:23 UTC".
34
35 my $string = Test::AutoBuild::Lib::pretty_time($seconds);
36 Formats an interval in seconds for friendly viewing according to
37 the style "2h 27m 12s" - ie 2 hours, 27 minutes and 12 seconds.
38
39 my $string = Test::AutoBuild::Lib::pretty_size($bytes);
40 Formats the size specified in the "bytes" parameter for friendly
41 viewing. If the number of bytes is > 1024x1024 then it formats in
42 MB, with 2 decimal places. Else if the number of bytes is > 1024 it
43 formats in kb with 2 decimal places. Otherwise it just formats as
44 bytes.
45
46 my $status = Test::AutoBuild::Lib::run($comnand, \%env);
47 Executes the program specified in the "command" argument. The
48 returned value is the output of the commands standard output
49 stream. Prior to running the command, the environment variables
50 specified in the "env" parameter are set. This environment is
51 modified locally, so the changes are only in effect for the
52 duration of this method.
53
54 ($config, $fh, $error) =
55 Test::AutoBuild::Lib::load_template_config($file, [\%vars])
56 This method loads the content of the configuration file $file,
57 passes it through the Template module, and then creates an instance
58 of the Config::Record module. The second optiona %vars parameter is
59 a hash reference containing a set of variables which will be passed
60 through to the templating engine. A 3 element list is returned, the
61 first element containing the Config::Record object, the second a
62 scalar containing the post-processed configuration file, the last
63 containing any error message generated.
64
66 Daniel Berrange <dan@berrange.com>, Dennis Gregorovic
67 <dgregorovic@alum.mit.edu>
68
70 Copyright (C) 2002-2005 Daniel Berrange <dan@berrange.com>
71
73 perl(1), Test::AutoBuild, Test::AutoBuild::Runtime, Template,
74 Config::Record
75
76
77
78perl v5.12.1 2007-12-08 Test::AutoBuild::Lib(3)