P is for Practical | |
PerlMonks |
Re: Writing tests for modules using database handlesby bikeNomad (Priest) |
on Aug 02, 2001 at 04:45 UTC ( [id://101550]=note: print w/replies, xml ) | Need Help?? |
Your test script could require a database handle to be set in a config file (and, of course, print a message if it isn't). The handle could be passed to the Makefile, as well. Look at the way that the various DBD modules do their testing. Isn't there a test database in the standard MySQL installation? That could be your default. The Device::SerialPort module does tests on a live serial port; if opening it fails, it prints out a message about how to change the configuration by editing a file.
In Section
Seekers of Perl Wisdom
|
|