1 |
#
|
2 |
# TestArea.pm
|
3 |
#
|
4 |
# Originally Written by Christopher Williams
|
5 |
#
|
6 |
# Description
|
7 |
#
|
8 |
# Interface
|
9 |
# ---------
|
10 |
# new(dir) : A new TestBuildArea object located relative to dir
|
11 |
# developerarea(dir) : return the developerarea object, configdir loction
|
12 |
# releasearea() : return the release area object
|
13 |
|
14 |
package Configuration::test::TestArea;
|
15 |
use Utilities::AddDir;
|
16 |
require 5.004;
|
17 |
|
18 |
sub new {
|
19 |
my $class=shift;
|
20 |
my $self={};
|
21 |
bless $self, $class;
|
22 |
$self->_constructarea(@_);
|
23 |
return $self;
|
24 |
}
|
25 |
|
26 |
sub releasearea {
|
27 |
my $self=shift;
|
28 |
return $self->{testarea};
|
29 |
}
|
30 |
|
31 |
sub _constructarea {
|
32 |
my $self=shift;
|
33 |
my $dir=shift;
|
34 |
|
35 |
#-- dummy environment
|
36 |
$self->{arch}="testarch";
|
37 |
$ENV{SCRAM_ARCH}=$self->{arch};
|
38 |
$ENV{INTwork}="tmp/".$ENV{SCRAM_ARCH};
|
39 |
$ENV{TOOL_HOME}=$ENV{SCRAM_HOME}."/src";
|
40 |
|
41 |
# -- make a release area
|
42 |
$self->{configareadir}="TestConfiguration";
|
43 |
$self->{testareadir}=$dir."/TestArea";
|
44 |
|
45 |
$self->{testarea}=Configuration::ConfigArea->new();
|
46 |
$self->{testarea}->name("TestProject");
|
47 |
$self->{testarea}->version("Version_1");
|
48 |
$self->{testarea}->configurationdir($self->{configareadir});
|
49 |
$self->{testarea}->setup($self->{testareadir});
|
50 |
}
|
51 |
|
52 |
sub developerarea {
|
53 |
my $self=shift;
|
54 |
my $dir=shift;
|
55 |
|
56 |
my $testdevareadir=$dir."/BuildDevArea";
|
57 |
my $testdevarea=$self->{testarea}->satellite($testdevareadir);
|
58 |
my $devconfigarea=$testdevarea->location()."/"
|
59 |
.$testdevarea->configurationdir();
|
60 |
AddDir::copydir($self->{datadir}."/".$self->{configareadir}
|
61 |
,$devconfigarea);
|
62 |
return ($testdevarea,$devconfigarea);
|
63 |
}
|