develooper Front page | perl.qa | Postings from April 2010

Re: sharing perl data structures across tests

Thread Previous | Thread Next
From:
Ovid
Date:
April 2, 2010 00:03
Subject:
Re: sharing perl data structures across tests
Message ID:
839942.90046.qm@web65714.mail.ac4.yahoo.com
--- On Wed, 31/3/10, Erik Osheim <erik@plastic-idolatry.com> wrote:

> From: Erik Osheim <erik@plastic-idolatry.com>

> So at $WORK we have a bunch of really
> large data (immutable) data
> structures which a ton of our source code uses. As such,
> most tests
> that we write need to access these data structures to run.
> These
> structures can't (currently) be serialized with Storable
> due to having
> LibXML objects in them (among other reasons).

I see no one's answered this yet. I was hoping for more clarification lest my (mis)understanding hampers things.  You have a large data structure to share across tests and I assume either some code builds it and others than need it or it's expensive to build?  If it's the former, it implies an ordering dependency and coupling in your tests which greatly lowers their utility.

If the structure is simply expensive, have you considered running tests in a single process to ensure the data structure doesn't go away?  Test::Class and Test::Aggregate can both let you do this.  
 
Cheers,
Ovid
--
Buy the book         - http://www.oreilly.com/catalog/perlhks/
Tech blog            - http://blogs.perl.org/users/ovid/
Twitter              - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6


Thread Previous | 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