Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

rblackwe (5489)

  (email not shown publicly)
AOL IM: robertdblackwell (Add Buddy, Send Message)
Yahoo! ID: robertblackwell (Add User, Send Message)

Journal of rblackwe (5489)

Saturday June 09, 2007
09:29 AM

Running your tests with Apache

[ #33481 ]

I have been working with TAP to test environment and other things that are not code.

Did I win the lottery?

Is my server up?


I have been running these with cron and I get email about the results. Well the trouble is when I have failing tests I want to see if the tests are still failing. I was in a place that was blocking ssh traffic. So it lead me to this solution.

I wrote a little prove wrapper.

use CGI;
my $q = new CGI;
print $q->header;
print $q->start_html('prove');
my $file = $q->param('file');
my $ok_file = {
        '/tests/action/ping.t'    => 1,
        '/tests/action/lottery.t' => 1,
my $out;
if ( $ok_file->{$file} ) {
        my $command = "/usr/home/pl129/public_html/bin/prove /usr/home/pl129/public_html$file 2>&1";
        $out = `$command`;
} else {
        $out = "<pre> $file not allowed </pre>";
print $q->h1($file);
print "<hr>";
print "<pre>$out</pre>";
print $q->end_html;

I added this to my .htaccess

AddHandler prove-type .t
Action prove-type /bin/proveit.cgi?v=1&file=

So know I can link to my tests:

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.