Writing tests

ethan on 2004-01-10T13:16:24

Continuing Device::CDROM, it's soon time for a first release. I am adding the documentation right now.

What really gives me headache are the tests. How would you test a module that performs ioctls to control the CDROM drive? What I can do is querying the capabilities of the drive and then do those things that it should be able to do. Like when CDC_OPEN_TRAY and CDC_CLOSE_TRAY are set, I can open and close the drive and check the return value of those commands.

Harder are those things that require a disc inside the drive. Also, for a thorough test the user would need to have a handful of different kind of discs: an audio CD, a data CD, one with multisession etc. Maybe I can divide the tests into those that can run non-interactively (those aren't very many) and all the others that need human interaction. Similar to what Term::ReadKey does.