Re: broken tests?

Fergal Daly <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.petal
Message-ID <[email protected]>
On Thu, Aug 12, 2004 at 06:46:23AM -0600, Bridget Almas wrote:
> As far as I can tell, the Petal installation works just fine (I'm not
> exercising it too heavily though). If I comment out the "use Test::More" and
> the like/unlike tests, the Petal test code also seems to work fine, so the
> problem must be in the test libraries.  I am using the latest version of
> Test::Simple (0.47) and Test::Harness (2.42).

Does your perl have thread support enabled? Try

perl -V

and see if THREAD or USE_ITHREAD is mentioned in Compile-time options.
Test-Builder (used by Test-More) calls some thread functions to make it
thread safe however I think 5.8.0 might not be the best thread-wise.

To see if this is the problem, you could change the bit at the start of
Test/Builder.pm. My one looks something like

BEGIN {
    use Config;
    if( $] >= 5.008 && $Config{useithreads} ) {
        require threads;
        require threads::shared;
        threads::shared->import;
    }
    else {
        *share = sub { 0 };
        *lock  = sub { 0 };
    }
}

changing

    if( $] >= 5.008 && $Config{useithreads} ) {

to

    if( 0 && $] >= 5.008 && $Config{useithreads} ) {

will turn off the thread stuff. If it works after that then you've found the
culprit.

Is there some particular reason you're using 5.8.0? The later versions fix a
lot of bugs and have tried to keep backwards compatibility,

F
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.