At 7:26 PM -0800 1/10/06, Tyler MacDonald wrote:
        Another option that occured to me while I was loading the dishwasher
was bundling SQLite2 (or something like it) in my t/ directory. Sure, it
will consume a bit of extra bandwidth when the package is downloaded, but it
won't leave the bloat around once it's tested, installed (or packaged up
into something like a .deb or .ppd), and the source tree is purged. But I
still find myself thinking "there's got to be a better way"...

Actually bundling SQLite is a waste of space for a CPAN distribution, partly because it is quite large relative to the site of your own code; like 10-100X.

As for answering your question, I suggest including a small config file with your distro which your test script looks at. Users can change that if they are testing an existing database setup of theirs, and if they don't customize this file, your test script will default to using SQLite so that the test suite can still test your module itself.

That's what the current/old Rosetta::Engine::Generic on CPAN does with its test suite, defaulting to SQLite (3); you can look at its tests for ideas.

FYI, the not yet released Rosetta rewrite will be different, and include its own mock database to test with (called Rosetta::Engine::Native), so that testing the core can be done completely without any third party database.

Depending on your goals, it might be worthwhile for you to have a mock database.

But whatever you do, don't bundle third party things like SQLite, unless your distribution is private/proprietary and the recipients aren't going to CPAN.

-- Darren Duncan

Reply via email to