Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Testing a module that writes logs to a fileby Hue-Bond (Priest) |
on Jun 09, 2008 at 13:55 UTC ( [id://691033]=perlquestion: print w/replies, xml ) | Need Help?? |
Hue-Bond has asked for the wisdom of the Perl Monks concerning the following question: Dear Monks, I'm writing a module that, among other things, writes logs to a file. Logs are kept in a subdirectory of /var/log, so the program can run as user (the subdirectory has the proper permissions). In the development environment all was good, since at the beginning I manually created the directory and set its permissions. Nevertheless, when installing the module in another machine, I found that the tests failed because when the module was going to write something to the logs, the directory didn't exist. Creating it manually wasn't an option, since that's make install responsibility. I needed make install /before/ make test... A quick search through the monastery led me to testing log messages, and I decided to follow that route. I hadn't any problem and now the tests pass even when no logs are actually created. However, I'd be surprised if I'd found the best solution in a 15 minute search ;^). Does a better option exist? (for any meaning of "better"). --
Back to
Seekers of Perl Wisdom
|
|