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?
etc.
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.
#!/usr/local/bin/perl
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 = " $file not allowed
";
}
print $q->h1($file);
print "
";
print "$out
";
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: