Micah Cowan
Sat, 05 Apr 2008 20:41:48 -0700
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Daniel Stenberg wrote: > In the curl project we took a simpler route: we have our own dumb test > servers in the test suite to run tests against and we have single files > that describe each test case: what the server should respond, what the > protocol dump should look like, what output to expect, what return code, > etc. Then we have a script that reads the test case description, fires > up the correct server(s), verifies > all the ouputs (optionally using valgrind). > > This system allows us to write unit-tests if we'd like to, but mostly so > far we've focused to test it system-wide. It is hard enough for us! Yeah, I thought I'd seen something like that; I was thinking we might even be able to appropriate some of that, if that looked doable. Except that I preferred faking the server completely, so I could deal better with cross-site issues, which AFAICT are significantly more important to Wget than they are to Curl. I was thinking, and should have said, that if we go this route, we'd want to focus on high-level tests first. That also has the advantage that if we accidentally change something during the refactoring process (not unlikely), we will notice it, whereas focusing just on unit tests would mean we'd have to change the code to be testable in units _before_ verification. We already _do_ have some spawn-a-server tests code, but much of it needs rewriting, and it still suffers when you bring in the idea of multiple servers. The servers are driven by Perl code, rather than a driver script or description file. - -- Micah J. Cowan Programmer, musician, typesetting enthusiast, gamer, and GNU Wget Project Maintainer. http://micah.cowan.name/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFH+EZz7M8hyUobTrERAjDxAJ9N3AbEVG6NTy735hy6KtjPO7jm8wCdFX+/ gLx9jZcp0ZQqE2bQAU7VdyQ= =u+PC -----END PGP SIGNATURE-----