develooper Front page | perl.perl5.porters | Postings from February 2009

Parallel unsafe tests in ext/IO/t/io_dir.t

Thread Next
From:
Bram
Date:
February 25, 2009 15:49
Subject:
Parallel unsafe tests in ext/IO/t/io_dir.t
Message ID:
20090226004959.pp3dh3im80kc4owk@horde.wizbit.be
There appear to be some parallel unsafe tests in ext/IO/t/io_dir.t:

Test 2 and 3:

@a = sort <*>;
do { $first = $dot->read } while defined($first) && $first =~ /^\./;
ok(+(grep { $_ eq $first } @a));

@b = sort($first, (grep {/^[^.]/} $dot->read));
ok(+(join("\0", @a) eq join("\0", @b)))

It compares the list of files returned by <*> with the list of files  
returned by $dot->read (with $dot = new IO::Dir $DIR;)

This test is not parallel safe since other tests can (and do) create  
files and/or directories in t/.


What would be the best way to change the test?
Should it do a chdir to ../ext/IO/t before running the test? Or...?


Kind regards,

Bram




Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About