Perl
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   Web Development Archives Mailing Lists Perl

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Web Development Archives Sponsor:
  #1  
Old July 3rd, 2008, 08:30 PM
James Keenan via RT
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
config/auto/icu.pm: Write unit tests

Coleoid just pasted this failure report:


# Failed test 'Got expected return value: failed'
# at t/steps/auto_icu-04.t line 48.
# got: 'no'
# expected: 'failed'
# Looks like you failed 1 test of 12.
Dubious, test returned 1
(wstat 256, 0x100)
Failed 1/12 subtests

Am looking into it.

kid51

Reply With Quote
  #2  
Old July 5th, 2008, 12:20 PM
James Keenan via RT
Guest
Dev Archives Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
config/auto/icu.pm: Write unit tests

Thanks to *considerable* testing assistance from Jason Cole in several
rounds of off-list correspondence, I have been able to identify the
problem that Jason reported and to trace it to a subtle, long-standing
bug in config/auto/icu.pm.

To diagnose this problem I created a new 'reautoicu' branch in the
repository and added considerable verbose output. Jason and I then
re-configured repeatedly with , as well as
running prove -v t/steps/auto_icu*.t. The verbose output that jason was
getting on Win32 was self-contradictory:

Determining whether ICU is installedDiscovered icu-config
returns 1
icu-config found good!
Trying icu-config with ''
icushared: captured
For icushared, found and 1
Trying icu-config with ''
icuheaders: captured
For icuheaders, found \include and 1
not found.

The line 'icu-config found good!' suggested that Jason had ICU
installed. But it was contradicted by the '1' values in three locations
-- system failure indicators rather than Perl truth -- and by the final
result: 'not found'. If someone really doesn't have ICU installed,
then the step should have exited with a different message at a point
*earlier* than the point at which 'not found' is the result.

To somewhat shorten a long story, there was code deep inside
config/auto/icu.pm like this:

( $arg->{ret} == -1 )
||
( ( $arg->{ret} >8 ) != 0 )

which seems to reflect what's stated here in the man page:

perldoc -f system

The return value is the exit status of the program as
returned
by the "wait" call. To get the actual exit value, shift
right
by eight

That sounded correct, until I asked the question: How is the value of
$arg->{ret} determined? Ultimately, it is set by an invocation of


my ( undef, undef, $ret ) =
capture_output( $self->{icuconfig_default}, "" );

But if we look at the source code for capture_output() (lines 238-260 of
lib/Parrot/Configure/Utils.pm), we see at line 246 that capture_output
*already applies the bitshifting* to the system command it calls. That
means that this line in config/auto/icu.pm:

( ( $arg->{ret} >8 ) != 0 )

is *one bit-shifting too many*!

I tore out the superfluous bit-shifting and both Jason and I were able
to get the expected verbose output during actual configuration and pass
all the tests. As a side benefit, I was able to rip out some branches
and conditions for which I had been unable to write tests and which were
lowering the coverage results.

So I have merged the 'reautoicu' branch into trunk as of r29083. Thanks
again to Coleoid for assistance with testing.

kid51

Reply With Quote
Reply

Viewing: Web Development Archives Mailing Lists Perl > config/auto/icu.pm: Write unit tests


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway