X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FTest.pm;h=bc5fdce6ea04e6b15b5eb4eac225461fed7fae94;hp=cab2e09e09ab0adf300ee51b912cb92a7ca6f369;hb=93ae498c754d95bd05d687220477be2fe4316757;hpb=a8ef4e0dce00d9c580d3d7875d48db36f9bdf37f diff --git a/lib/ZOOM/IRSpy/Test.pm b/lib/ZOOM/IRSpy/Test.pm index cab2e09..bc5fdce 100644 --- a/lib/ZOOM/IRSpy/Test.pm +++ b/lib/ZOOM/IRSpy/Test.pm @@ -1,4 +1,4 @@ -# $Id: Test.pm,v 1.2 2006-07-21 11:30:51 mike Exp $ +# $Id: Test.pm,v 1.5 2006-10-13 10:07:36 sondberg Exp $ package ZOOM::IRSpy::Test; @@ -6,6 +6,9 @@ use 5.008; use strict; use warnings; +use Exporter 'import'; +our @EXPORT = qw(isodate); + =head1 NAME ZOOM::IRSpy::Test - base class for tests in IRSpy @@ -20,39 +23,29 @@ I<## To follow> =cut -sub new { +sub subtests { () } + +sub start { my $class = shift(); - my($irspy) = @_; + my($conn) = @_; - return bless { - irspy => $irspy, - }, $class; + die "can't start the base-class test"; } -sub irspy { - my $this = shift(); - return $this->{irspy}; +sub get_handle { + return $_->{'handle'}; } -sub run { - my $this = shift(); - die "can't run the base-class test"; -} - -### Could include loop detection -sub run_tests { - my $this = shift(); - my @tname = @_; - my $res = 0; - foreach my $tname (@tname) { - my $sub = $this->irspy()->_run_test($tname); - $res = $sub if $sub > $res; - } +# Utility function, really nothing to do with IRSpy +sub isodate { + my($time) = @_; - return $res; + my($sec, $min, $hour, $mday, $mon, $year) = localtime($time); + return sprintf("%04d-%02d-%02dT%02d:%02d:%02d", + $year+1900, $mon+1, $mday, $hour, $min, $sec); }