On 2005-10-09, Cees Hek <suppressed> wrote:
>
> For a quick example of how easy this really is, have a look at the
> test suite for Data::FormValidator::Filters::Image. There I don't
> even bother with LWP::UserAgent, and just use HTTP::Request::Common
> directly to create a valid POST request with a file upload, and then
> write that to a forked process which cleanly simulates a CGI request.
>
> http://search.cpan.org/src/CEESHEK/Data-FormValidator-Filters-Image-0.2/t/01_basic.t
Thanks sharing this.
> I like this method, because it doesn't require a webserver to be
> running, which can sometimes be a pain to deal with. It effectively
> takes the place of a webserver by (mostly) following the CGI spec by
> setting some ENV vars, forking a process to execute the CGI script,
> and printing the HTTP request to the forked child (maybe there is
> already a module that does all this - besides HTTP::Server::Simple
> which is still an HTTP server that listens on a port).
In your test script you into an issue which I understand is difficult to
solve: the test framework doesn't play well with forking.
It's not clear to me how Test::CGI::Application would work around that.
Will just printing the test messages directly be sufficient?
I've added some notes on this potential project to the wiki:
http://cgiapp.erlbaum.net/cgi-bin/cgi-app/index.cgi?PluginsWanted
Mark
--
http://mark.stosberg.com/
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.