1 |
williamc |
1.1 |
#
|
2 |
|
|
# TestBuildArea.pm
|
3 |
|
|
#
|
4 |
|
|
# Originally Written by Christopher Williams
|
5 |
|
|
#
|
6 |
|
|
# Description
|
7 |
|
|
#
|
8 |
|
|
# Interface
|
9 |
|
|
# ---------
|
10 |
|
|
# new(dir,datadir) : A new TestBuildArea object located relative to dir
|
11 |
|
|
# - configuration src etc picked up from datadir
|
12 |
|
|
# developerarea(dir) : return the developerarea object, configdir loction
|
13 |
|
|
# twigdir() : return the twigsrc directory
|
14 |
|
|
# releasearea() : return the release area object
|
15 |
|
|
|
16 |
|
|
package BuildSystem::test::TestBuildArea;
|
17 |
|
|
use Utilities::AddDir;
|
18 |
|
|
require 5.004;
|
19 |
|
|
|
20 |
|
|
sub new {
|
21 |
|
|
my $class=shift;
|
22 |
|
|
my $self={};
|
23 |
|
|
bless $self, $class;
|
24 |
|
|
$self->_constructarea(@_);
|
25 |
|
|
return $self;
|
26 |
|
|
}
|
27 |
|
|
|
28 |
|
|
sub releasearea {
|
29 |
|
|
my $self=shift;
|
30 |
|
|
return $self->{testarea};
|
31 |
|
|
}
|
32 |
|
|
|
33 |
|
|
sub twigdir {
|
34 |
|
|
my $self=shift;
|
35 |
|
|
return "src/sub/twig";
|
36 |
|
|
}
|
37 |
|
|
|
38 |
|
|
sub _constructarea {
|
39 |
|
|
my $self=shift;
|
40 |
|
|
my $dir=shift;
|
41 |
|
|
my $datadir=shift;
|
42 |
williamc |
1.2 |
$self->{datadir}=$datadir;
|
43 |
williamc |
1.1 |
|
44 |
|
|
#-- dummy environment
|
45 |
|
|
$self->{arch}="testarch";
|
46 |
|
|
$ENV{SCRAM_ARCH}=$self->{arch};
|
47 |
|
|
$ENV{INTwork}="tmp/".$ENV{SCRAM_ARCH};
|
48 |
|
|
$ENV{TOOL_HOME}=$ENV{SCRAM_HOME}."/src";
|
49 |
|
|
|
50 |
|
|
# -- make a release area
|
51 |
|
|
$self->{configareadir}="TestConfiguration";
|
52 |
|
|
$self->{testareadir}=$dir."/TestBuildArea";
|
53 |
|
|
|
54 |
|
|
$self->{testarea}=Configuration::ConfigArea->new();
|
55 |
|
|
$self->{testarea}->name("BuildSetup");
|
56 |
|
|
$self->{testarea}->version("test");
|
57 |
|
|
$self->{testarea}->configurationdir($self->{configareadir});
|
58 |
|
|
$self->{testarea}->setup($self->{testareadir});
|
59 |
|
|
|
60 |
|
|
# -- dummy src code
|
61 |
|
|
AddDir::copydir($datadir."/testsrcs/src",
|
62 |
|
|
$self->{testarea}->location()."/src");
|
63 |
|
|
|
64 |
|
|
|
65 |
|
|
# -- Build System Test Configuration
|
66 |
|
|
$self->{configarea}=$self->{testarea}->location()."/"
|
67 |
|
|
.$self->{testarea}->configurationdir();
|
68 |
|
|
AddDir::copydir($datadir."/".$self->{configareadir}
|
69 |
|
|
,$self->{configarea});
|
70 |
|
|
}
|
71 |
|
|
|
72 |
|
|
sub developerarea {
|
73 |
|
|
my $self=shift;
|
74 |
|
|
my $dir=shift;
|
75 |
|
|
|
76 |
|
|
my $testdevareadir=$dir."/BuildDevArea";
|
77 |
williamc |
1.2 |
my $testdevarea=$self->{testarea}->satellite($testdevareadir);
|
78 |
|
|
my $devconfigarea=$testdevarea->location()."/"
|
79 |
|
|
.$testdevarea->configurationdir();
|
80 |
williamc |
1.1 |
AddDir::copydir($self->{datadir}."/".$self->{configareadir}
|
81 |
|
|
,$devconfigarea);
|
82 |
|
|
return ($testdevarea,$devconfigarea);
|
83 |
|
|
}
|