X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FTest.pm;h=83ad68678e5e364e98830297b7878ef586e9e105;hp=20fa772162164d9f83e90acea99eaaf0b75f6e3f;hb=880bb74a2cc77e58aa99cbaeb300435316417e76;hpb=378c5b5e691e85900047ef38a913cc69b6537edc diff --git a/lib/ZOOM/IRSpy/Test.pm b/lib/ZOOM/IRSpy/Test.pm index 20fa772..83ad686 100644 --- a/lib/ZOOM/IRSpy/Test.pm +++ b/lib/ZOOM/IRSpy/Test.pm @@ -1,4 +1,4 @@ -# $Id: Test.pm,v 1.3 2006-07-21 11:49:27 mike Exp $ +# $Id: Test.pm,v 1.4 2006-10-06 11:33:07 mike 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,38 +23,23 @@ I<## To follow> =cut -sub new { - my $class = shift(); - my($irspy) = @_; - - return bless { - irspy => $irspy, - }, $class; -} - - -sub irspy { - my $this = shift(); - return $this->{irspy}; -} +sub subtests { () } +sub start { + my $class = shift(); + my($conn) = @_; -sub run { - my $this = shift(); - die "can't run the base-class test"; + die "can't start the base-class test"; } -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); }