ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/BuildSystem/test/test_ToolBox.pm
Revision: 1.1.2.3
Committed: Wed May 17 13:56:50 2000 UTC (25 years ago) by williamc
Content type: text/plain
Branch: V0_9branch
CVS Tags: V0_12_12_4, V0_12_12_3, V0_12_12_2, V0_12_12_1, V0_12_12_0, PlayGround_0, V0_13_0, V0_12_12, V0_12_11, V0_12_9b, V0_12_10, V0_12_9, V0_12_8
Branch point for: HPWbranch
Changes since 1.1.2.2: +19 -1 lines
Log Message:
Add stub routines

File Contents

# User Rev Content
1 williamc 1.1.2.1 #
2     # ToolBox.pm test suite
3     #
4    
5     package BuildSystem::test::test_ToolBox;
6     require 5.001;
7     use BuildSystem::ToolBox;
8    
9     @ISA=qw(Utilities::TestClass); #methods both from the test class
10    
11     sub init {
12     my $self=shift;
13     $self->{testarea}=$self->temparea()."/TestArea";
14     $self->{testfile}=$self->datadir()."/ToolDocTest";
15 williamc 1.1.2.3 $self->{reqdoc}=$self->datadir()."/RequirementsDocTest";
16 williamc 1.1.2.1
17     # make a dummy area
18     $ENV{LOCALTOP}=$self->{testarea};
19     $ENV{projconfigdir}="config";
20     $ENV{SCRAM_ARCH}="TestArch";
21    
22     AddDir::adddir($self->{testarea}."/".$ENV{projconfigdir});
23     use File::Copy;
24     my $depsfile="External_Dependencies";
25     $self->{testdepsfile}=$self->datadir()."/".$depsfile;
26     copy($self->{testdepsfile},$self->{testarea}."/".$ENV{projconfigdir}."/".$depsfile)
27     or die $!."\n";
28     }
29    
30     sub test {
31     my $self=shift;
32     $self->newtest("Initiation test");
33 williamc 1.1.2.3 $self->newobject($self);
34 williamc 1.1.2.1 $self->testinterface("verbosity","1");
35    
36    
37     $self->newtest("Tool Setup Testing");
38     $self->testinterface("toolsetup","test","version1","Test");
39    
40     $self->newtest("Default Version Test");
41     $self->_testversions();
42    
43     $self->newtest("Tool Setup Testing - url from tool object");
44     $self->testinterface("toolsetup","test","version1");
45    
46     $self->newtest("Tool Setup Testing - url from tool object ".
47     "and default version");
48     $self->testinterface("toolsetup","test");
49    
50     $self->newtest("gettool test - undefined expected");
51     $self->expect(undef);
52     $self->testinterface("gettool","notool");
53     $self->testinterface("gettool","notool","noversion");
54     $self->clearexpect();
55 williamc 1.1.2.2
56     $self->newtest("Setting a Searcher");
57     $self->testinterface("searcher");
58 williamc 1.1.2.1 }
59    
60     sub _testversions {
61     my $self=shift;
62     $self->expect("version1");
63     $self->testinterface("defaultversion","test");
64     $self->clearexpect();
65     $self->expect("version2");
66     $self->testinterface("defaultversion","test2");
67     $self->clearexpect();
68 williamc 1.1.2.3 }
69    
70     # --- stubs
71    
72     sub location {
73     my $self=shift;
74     return $self->{testarea};
75     }
76    
77     sub configurationdir {
78     my $self=shift;
79     return $self->{testarea}."/".$ENV{projconfigdir};
80     }
81    
82     sub requirementsdoc {
83     my $self=shift;
84     return $self->{reqdoc};
85 williamc 1.1.2.1 }