http://www.perlmonks.org?node_id=101550


in reply to Writing tests for modules using database handles

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.

  • Comment on Re: Writing tests for modules using database handles