1 |
#
|
2 |
# BuildSetup.pm test suite
|
3 |
#
|
4 |
|
5 |
package BuildSystem::test::test_BuildSetup;
|
6 |
require 5.001;
|
7 |
use BuildSystem::BuildSetup;
|
8 |
|
9 |
@ISA=qw(Utilities::TestClass); #methods both from the test class
|
10 |
|
11 |
sub init {
|
12 |
my $self=shift;
|
13 |
$self->{testfile}=$self->datadir()."/BuildFileDoc";
|
14 |
|
15 |
require BuildSystem::test::TestBuildArea;
|
16 |
$self->{tba}=BuildSystem::test::TestBuildArea->new($self->temparea(),
|
17 |
$self->datadir());
|
18 |
$self->{testarea}=$self->{tba}->releasearea();
|
19 |
$self->{dirconfigarea}=$self->{testarea}->location()."/".
|
20 |
$self->{testarea}->configurationdir();
|
21 |
|
22 |
}
|
23 |
|
24 |
sub test {
|
25 |
my $self=shift;
|
26 |
$self->newtest("Initiation test");
|
27 |
$self->newobject($self->{testarea});
|
28 |
$self->testinterface("verbosity",1);
|
29 |
my $twigdir=$self->{tba}->twigdir();
|
30 |
my $work=$self->{object}->{fullworkdir};
|
31 |
$self->verifyexists($work."/".$self->{testarea}->configurationdir().
|
32 |
"/BuildFile.mk");
|
33 |
|
34 |
$self->newtest("Class Setup Testing");
|
35 |
my $twigmake=$self->{testarea}->location()."/".$ENV{INTwork}.
|
36 |
"/twig_makefile.mk";
|
37 |
my $localbuildfile=$self->{testarea}->location()."/".$ENV{INTwork}.
|
38 |
"/".$twigdir."/BuildFile.mk";
|
39 |
$self->expect("twig",$twigdir, $twigmake);
|
40 |
$self->testinterface("classsetup",$twigdir);
|
41 |
# -- test multiple calls
|
42 |
$self->newtest("Class Setup Testing - multiple calls");
|
43 |
$self->testinterface("classsetup",$twigdir);
|
44 |
$self->clearexpect();
|
45 |
$self->verifyexists($twigmake);
|
46 |
$self->verifyexists($localbuildfile);
|
47 |
|
48 |
# $self->newtest("General Build Testing");
|
49 |
# $self->testinterface("BuildDir");
|
50 |
# $self->verifyexists($self->{testarea}->location()."/".$ENV{INTwork}.
|
51 |
# "/DEFAULT_makefile.mk");
|
52 |
|
53 |
$self->newtest("getclass test - no argument");
|
54 |
$self->expect("DEFAULT",".");
|
55 |
$self->testinterface("getclass");
|
56 |
$self->clearexpect();
|
57 |
$self->newtest("getclass test - direct mapped class");
|
58 |
$self->expect("twig","src/sub/twig");
|
59 |
$self->testinterface("getclass", $twigdir);
|
60 |
$self->clearexpect();
|
61 |
$self->newtest("getclass test - indirect mapped class");
|
62 |
$self->expect("twig","src/sub/twig");
|
63 |
$self->testinterface("getclass", $twigdir."/lib");
|
64 |
$self->clearexpect();
|
65 |
|
66 |
$self->newtest("makefile composition testing");
|
67 |
$self->testinterface("BuildIt");
|
68 |
}
|
69 |
|
70 |
# === dummy routines
|
71 |
|
72 |
sub tools {
|
73 |
return ();
|
74 |
}
|