1Test::AutoBuild::PlatfoUrsme(r3)Contributed Perl DocumenTteastti:o:nAutoBuild::Platform(3)
2
3
4
6 Test::AutoBuild::Platform - represents a build host's environment
7
9 use Test::AutoBuild::Platform;
10
11 # Create a new platform based on the host machine's native
12 # environment
13 my $platform = Test::AutoBuild::Platform->new(name => "host");
14
15 # Or create a platform describing a chroot environment which
16 # has a differing OS, but same architecture
17 my $platform = Test::AutoBuild::Platform->new(name => "host",
18 label => "Fedora Core 3");
19
20 # Or create a platform describing an emulated OS
21 my $platform = Test::AutoBuild::Platform->new(name => "host",
22 label => "Free BSD",
23 operating_system => "bsd",
24 architecture => "x86_64");
25
26 # Create a platform describing the host, with some 'interesting'
27 # extra metadata about the toolchain
28 my $platform = Test::AutoBuild::Platform->new(name => "host",
29 options => {
30 'compiler.cc' => "GCC 3.2.3",
31 'compiler.c++' => "G++ 3.2.3",
32 'linker' => "GNU LD 2.15",
33 });
34
36 my $stage = Test::AutoBuild::Platform->new(name => $name, [label =>
37 $label,]); [architecture => $arch,]); [operating_system => $os,]
38 [options => \%options]);
39 Creates a new platform object describing a build root environment.
40 The "name" parameter is a short tag for the platform. The optional
41 "label" parameter is a free text descriptive title for the plat‐
42 form, typically the OS distribution name. If omitted, the first
43 line of /etc/issue will be used. The "architecture" parameter is
44 the formal machine architecture, defaulting to the 'machine' field
45 from the uname(2) system call. The "operating_system" parameter is
46 the formal operating system name, defaulting to the 'sysname' field
47 from the uname(2) system call. The optional "options" parameter is
48 a hash reference containing arbitrary deployment specific metadata
49 about the platform.
50
51 $value = $platform->option($name[, $newvalue]);
52 Retrieves a custom option describing a custom aspect of the build
53 host platform, identified as interesting by the administrator. If
54 the $newvalue parameter is supplied, then the configuration option
55 is updated.
56
57 my @names = $platform->options;
58 Return a list of all custom options set against this platform. The
59 names returned can be used in calling the "option" method to lookup
60 a value.
61
63 Daniel Berrange <dan@berrange.com>, Dennis Gregorovic <dgre‐
64 gorovic@alum.mit.edu>
65
67 Copyright (C) 2005 Daniel Berrange
68
70 perl(1), Test::AutoBuild, Test::AutoBuild::Runtime
71
72
73
74perl v5.8.8 2007-12-09 Test::AutoBuild::Platform(3)