New
[irspy-moved-to-github.git] / lib / ZOOM / IRSpy / Test.pm
1 # $Id: Test.pm,v 1.1 2006-06-20 16:32:42 mike Exp $
2
3 package ZOOM::IRSpy::Test;
4
5 use 5.008;
6 use strict;
7 use warnings;
8
9 =head1 NAME
10
11 ZOOM::IRSpy::Test - base class for tests in IRSpy
12
13 =head1 SYNOPSIS
14
15  ### To follow
16
17 =head1 DESCRIPTION
18
19 I<### To follow>
20
21 =cut
22
23 sub new {
24     my $class = shift();
25     my($irspy) = @_;
26
27     return bless {
28         irspy => $irspy,
29     }, $class;
30 }
31
32
33 sub irspy {
34     my $this = shift();
35     return $this->{irspy};
36 }
37
38
39 sub run {
40     my $this = shift();
41     die "can't run the base-class test";
42 }
43
44 ### Could include loop detection
45 sub run_tests {
46     my $this = shift();
47     my @tname = @_;
48
49     my $res = 0;
50     foreach my $tname (@tname) {
51         my $sub = $this->irspy()->_run_test($tname);
52         $res = $sub if $sub > $res;
53     }
54
55     return $res;
56 }
57
58
59 =head1 SEE ALSO
60
61 ZOOM::IRSpy
62
63 =head1 AUTHOR
64
65 Mike Taylor, E<lt>mike@indexdata.comE<gt>
66
67 =head1 COPYRIGHT AND LICENSE
68
69 Copyright (C) 2006 by Index Data ApS.
70
71 This library is free software; you can redistribute it and/or modify
72 it under the same terms as Perl itself, either Perl version 5.8.7 or,
73 at your option, any later version of Perl 5 you may have available.
74
75 =cut
76
77 1;