ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Testing/TestSuite.pm
Revision: 1.1
Committed: Wed Aug 17 14:31:41 2005 UTC (19 years, 8 months ago) by sashby
Content type: text/plain
Branch: MAIN
Log Message:
Added testing utils.

File Contents

# User Rev Content
1 sashby 1.1 #____________________________________________________________________
2     # File: TestSuite.pm
3     #____________________________________________________________________
4     #
5     # Author: Shaun Ashby <Shaun.Ashby@cern.ch>
6     # Update: 2005-08-17 15:49:06+0200
7     # Revision: $Id$
8     #
9     # Copyright: 2005 (C) Shaun Ashby
10     #
11     #--------------------------------------------------------------------
12     package TestSuite;
13    
14     =head1 NAME
15    
16     TestSuite - A package to contain testing routines for each SCRAM command.
17    
18     =head1 SYNOPSIS
19    
20     my $obj = TestSuite->new();
21     $obj->run();
22     $obj->statusreport();
23    
24     =head1 DESCRIPTION
25    
26     A testing utility. This runs the installed scram script B<scram.pl> using
27     B<system()>, passing whichever arguments are needed. Each command has a
28     self-contained set of tests in its own subroutine in this package to fully
29     exercise all supported options.
30    
31     This package is used only by the test script B<testsuite.pl> found in the
32     Testing directory.
33    
34     When a new command or command option is introduced, a subroutine in this package
35     must be created (or modified, if an option is added) to define a test.
36    
37     =head1 METHODS
38    
39     =over
40    
41     =cut
42    
43     require 5.004;
44     use Exporter;
45     use Installation::SCRAM_SITE;
46     use SCRAM::SCRAM;
47    
48     @ISA=qw(Exporter);
49     @EXPORT_OK=qw( );
50    
51    
52     sub new()
53     {
54     ###############################################################
55     # new #
56     ###############################################################
57     # modified : Wed Aug 17 15:49:14 2005 / SFA #
58     # params : #
59     # : #
60     # function : #
61     # : #
62     ###############################################################
63     my $proto=shift;
64     my $class=ref($proto) || $proto;
65     my $self={};
66     bless $self,$class;
67    
68     $self->{SCRAM} = SCRAM::SCRAM->new();
69     $self->{COMMANDS} = $self->{SCRAM}->commands();
70     $self->{SCRAMMAIN} = $ENV{'SCRAM_HOME'}."/src/main/scram.pl";
71    
72     # Check to make sure that SCRAM installation has already been done:
73     die "SCRAM TestSuite: Unable to find the installed scram script!","\n"
74     if (! -f $self->{SCRAMMAIN});
75    
76     return $self;
77     }
78    
79     sub run()
80     {
81     my $self=shift;
82     map { print "-> Running test for \"".$_."\" command\n"; $self->$_(); }
83     @{$self->{COMMANDS}};
84     }
85    
86     sub statusreport()
87     {
88     my $self=shift;
89     }
90    
91     sub version()
92     {
93     my $self=shift;
94     }
95    
96     sub arch()
97     {
98     my $self=shift;
99     }
100    
101     sub runtime()
102     {
103     my $self=shift;
104     }
105    
106     sub config()
107     {
108     my $self=shift;
109     }
110    
111     sub list()
112     {
113     my $self=shift;
114     }
115    
116     sub db()
117     {
118     my $self=shift;
119     }
120    
121     sub urlget()
122     {
123     my $self=shift;
124     }
125    
126     sub project()
127     {
128     my $self=shift;
129     }
130    
131     sub setup()
132     {
133     my $self=shift;
134     }
135    
136     sub tool()
137     {
138     my $self=shift;
139     }
140    
141     sub ui()
142     {
143     my $self=shift;
144     }
145    
146     sub build()
147     {
148     my $self=shift;
149     }
150    
151     sub xmlmigrate()
152     {
153     my $self=shift;
154     }
155    
156     sub install()
157     {
158     my $self=shift;
159     }
160    
161     sub remove()
162     {
163     my $self=shift;
164     }
165    
166    
167     1;
168    
169     __END__
170    
171    
172     =back
173    
174     =head1 AUTHOR/MAINTAINER
175    
176     Shaun Ashby
177    
178     =cut
179