If you're testing just the main runmode, it's pretty easy:
--
use Test::More qw/ no_plan /;
use MyApp;
$ENV{'CGI_APP_RETURN_ONLY'} = 1;
my $app = MyApp->new;
my $html = $app->run;
--
Save that as a test script and then run it with DProf:
perl -d:DProf 01-basic.t
If you need to emulate a specific runmode or user data, add in a CGI
instance with the parameters:
my $cgi = CGI->new( { rm => 'other_runmode', form_field_1 => 'data' } );
my $app = MyApp->new( QUERY => $cgi );
- Jason
William Bulley wrote:
> According to Jason Purdy <[email protected]> on Thu, 11/04/10 at 11:16:
>> You can emulate the request by using the cgiapp module directly with a
>> test script and then profile it's execution.
>
> Can you elaborate on this for my edification? I am somewhat new to the
> CGI::App world.
>
> Regards,
>
> web...
>
> --
> William Bulley Email: [email protected]
>
> 72 characters width template ----------------------------------------->|
>
> ##### CGI::Application community mailing list ################
> ## ##
> ## To unsubscribe, or change your message delivery options, ##
> ## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp ##
> ## ##
> ## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ##
> ## Wiki: http://cgiapp.erlbaum.net/ ##
> ## ##
> ################################################################
##### CGI::Application community mailing list ################
## ##
## To unsubscribe, or change your message delivery options, ##
## visit: http://www.erlbaum.net/mailman/listinfo/cgiapp ##
## ##
## Web archive: http://www.erlbaum.net/pipermail/cgiapp/ ##
## Wiki: http://cgiapp.erlbaum.net/ ##
## ##
################################################################