On 2008-07-28 22:54:20 -0700, Robert Spier wrote: > Matt Sergeant wrote: > > On Mon, 28 Jul 2008 20:47:39 -0400, Brian Szymanski wrote: > > > Then let's make that diff instead - remove all the "use > > > Qpsmtpd::Constants" in plugins, and add your test harness? > > > > I agree. Make your tester run the same code in Qpsmtpd.pm (or is it now > > in Plugin.pm, I don't recall) that compiles the plugins and checks the > > status. > > I'm actually +1 on making the plugins more syntactically correct. > It's really useful to be able to just run perl -c on them.
I agree that it's useful, but it would be even more useful if there was a testsuite which tested those plugins. "make test" catches simple syntax errors as well (without the false positives of perl -c), but it also catches behavioral problems. There is a simple test suite - maybe we just need to add some testcases for the plugins in question? For plugins which are not in the main distribution, testing is a bit awkward, though. I have added test cases to several of the plugins I added to contrib (which reminds me - I have a few new plugins I should put there), and it's not entirely straightforward. Maybe I'm doing something wrong. What is completely missing from the test suite is a framework to test a deployed and running qpsmtpd. This would be what would seem to be the most natural way to me: Start a qpsmtpd in a sandbox, send it SMTP commands and check how it reacts. > Putting complex logic in the tester, or duplicating that logic is a > bad idea. There's quite complex logic in qpsmtpd - ideally, the tester reuses this. In the second best case the tester duplicates it - then you have duplicated it once. But duplicating it in every plugin or every test case is the worst case - then you have to maintain it in lots of different places. hp -- _ | Peter J. Holzer | Openmoko has already embedded |_|_) | Sysadmin WSR | voting system. | | | [EMAIL PROTECTED] | Named "If you want it -- write it" __/ | http://www.hjp.at/ | -- Ilja O. on [EMAIL PROTECTED]
signature.asc
Description: Digital signature