From 9a6e77c4ebf64fc359bbe124e4f38bf4eba10914 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 9 Mar 2006 01:00:27 +0000 Subject: [PATCH] cleanup tests, make testCodebase.pl work with traditional --configFile syntax --- sbin/testCodebase.pl | 16 ++++++++++++---- t/Asset/Asset_diagnose.t | 1 + t/Session/DateTime.t | 16 +--------------- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/sbin/testCodebase.pl b/sbin/testCodebase.pl index 78eca75f6..09e46dd69 100644 --- a/sbin/testCodebase.pl +++ b/sbin/testCodebase.pl @@ -13,6 +13,7 @@ $|=1; use strict; use FindBin; use lib "$FindBin::Bin/../t/lib"; +use File::Spec qw[]; use Getopt::Long; my $configFile; @@ -45,16 +46,23 @@ my $helpmsg=<canonpath($FindBin::Bin.'/../etc/'.$configFile); + } + if (-e $configFile) { + system("WEBGUI_CONFIG=".$configFile." ".$perlBase."prove ".$verboseFlag." -r ../t"); + } + else { + die "Unable to use $configFile as a WebGUI config file\n"; + } } elsif ( defined @ENV{WEBGUI_CONFIG} ) { system($perlBase."prove ".$verboseFlag." -r ../t"); - exit; } else { print $helpmsg; } diff --git a/t/Asset/Asset_diagnose.t b/t/Asset/Asset_diagnose.t index 8eda7dfe6..801f21cb2 100644 --- a/t/Asset/Asset_diagnose.t +++ b/t/Asset/Asset_diagnose.t @@ -47,6 +47,7 @@ SKIP: { foreach my $asset ( @assets ) { diag("Checking $asset"); + eval "use $asset"; my $def = $asset->definition($session); my $tableName = $def->[0]->{tableName}; my $classIds = $session->db->buildArrayRef("select distinct(assetId) from asset where className=? order by assetId", [$asset]); diff --git a/t/Session/DateTime.t b/t/Session/DateTime.t index caa7c7ae1..88339da73 100644 --- a/t/Session/DateTime.t +++ b/t/Session/DateTime.t @@ -15,7 +15,7 @@ use lib "$FindBin::Bin/../lib"; use WebGUI::Test; use WebGUI::Session; -use Test::More tests => 63; # increment this value for each test you create +use Test::More tests => 26; # increment this value for each test you create my $session = WebGUI::Test->session; @@ -75,18 +75,4 @@ is($session->datetime->timeToSeconds("08:00:00"), 60*60*8, "timeToSeconds()"); "%Y" => "%y" ); -diag("check WebGUI to DateTime conversion"); -foreach my $wg (keys %conversion) { - is( $session->datetime->wgToDt($wg), $conversion{$wg}, - sprintf "WG to DT format conversion: %s => %s", $wg, $conversion{$wg}); -} -%conversion = reverse %conversion; - -delete $conversion{'%_varmonth_'}; - -diag("check DateTime to WebGUI conversion"); -foreach my $dt (keys %conversion) { - is( $session->datetime->dtToWg($dt), $conversion{$dt}, - sprintf "WG to DT format conversion: %s => %s", $dt, $conversion{$dt}); -}