Skip Menu |
 
rt.cpan.org will be shut down on March 1st, 2021.

This queue is for tickets about the Business-Hours CPAN distribution.

Report information
The Basics
Id: 13374
Status: resolved
Priority: 0/
Queue: Business-Hours

People
Owner: Nobody in particular
Requestors: mikef [...] pocketlint.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.06
Fixed in: (no value)

Attachments
libbusiness-hours-perl.patch



Subject: Test Failure on Install
Download (untitled) / with headers
text/plain 1.5k
Show quoted text
cpan> install Business::Hours
Running install for module Business::Hours Running make for J/JE/JESSE/Business-Hours-0.06.tar.gz Is already unwrapped into directory /root/.cpan/build/Business-Hours-0.06 Has already been processed within this session Running make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/embedded-Business-Hours....NOK 4 # Failed test (lib/Business/Hours.pm at line 199) # got: '162001' # expected: '162000' t/embedded-Business-Hours....NOK 6 # Failed test (lib/Business/Hours.pm at line 399) # got: '86400' # expected: '0' t/embedded-Business-Hours....ok 13/0# Looks like you failed 2 tests of 13. t/embedded-Business-Hours....dubious Test returned status 2 (wstat 512, 0x200) DIED. FAILED tests 4, 6 Failed 2/13 tests, 84.62% okay Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/embedded-Business-Hours.t 2 512 13 2 15.38% 4 6 Failed 1/1 test scripts, 0.00% okay. 2/13 subtests failed, 84.62% okay. *** Error code 2 Stop in /root/.cpan/build/Business-Hours-0.06. /usr/bin/make test -- NOT OK Running make install make test had returned bad status, won't install without force uname -a: 5.4-RELEASE FreeBSD 5.4-RELEASE #0: Sun May 8 10:21:06 UTC 2005 root@harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 I also tried it on 5.3-RELEASE with the same results. perl -v: This is perl, v5.8.6 built for i386-freebsd-64int
From: rudolph [...] usyd.edu.au
Download (untitled) / with headers
text/plain 138b
I've attached a patch that seems to fix the problem for me. It also includes an addition to the make process to dtrt with the testing dir.
--- libbusiness-hours-perl-0.06.orig/lib/Business/Hours.pm +++ libbusiness-hours-perl-0.06/lib/Business/Hours.pm @@ -191,7 +191,7 @@ my $hours = Business::Hours->new(); is(ref($hours), 'Business::Hours'); # how many business hours were there in the first week. -my $hours_span = $hours->for_timespan(Start => '0', End => ( (86400 * 7))); +my $hours_span = $hours->for_timespan(Start => '0', End => ( (86400 * 7) - 1)); is(ref($hours_span), 'Set::IntSpan'); # Are there 45 working hours @@ -429,7 +429,7 @@ my $end = $start + $period; my $hours = new Set::IntSpan; - while (!$hours->first) { + while (!defined($hours->first)) { if ($hours->last >= $start + $MAXTIME) { return -1; } --- libbusiness-hours-perl-0.06.orig/Makefile.PL +++ libbusiness-hours-perl-0.06/Makefile.PL @@ -20,6 +20,7 @@ $out =~ s/^(pure_all\b.*)/$1 testifypods/m; $out .= "\n\ntestifypods : \n"; + $out .= "\ttest -d t/ || mkdir t/\n"; foreach my $pod (keys %{$self->{MAN1PODS}}, keys %{$self->{MAN3PODS}}) @@ -32,8 +33,21 @@ $out .= "\t$self->{NOECHO}\$(POD2TEST_EXE) ". "$pod t/$test\n"; } - + return $out; } + + sub clean + { + my($self) = @_; + + $out = $self->SUPER::clean(@_); + $out =~ s/^(clean\b.*)/$1 cleantestdir/m; + + $out .= "\n\ncleantestdir : \n"; + $out .= "\t\$(RM_RF) t/\n"; + + return $out; + } }
RT-Send-CC: rudolph [...] usyd.edu.au
Download (untitled) / with headers
text/plain 220b
I've fixed these problems (and hopefully more) on our SVN repository; they should be fixed in a new version on CPAN shortly. --dave Code Monkey, Best Practical Solutions -- David Glasser | glasser@bestpractical.com


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.