5ad4a817cd538de8f29bfb238d50b054484ece64
[irspy-moved-to-github.git] / web / htdocs / details / check.mc
1 %# $Id: check.mc,v 1.6 2006-09-26 10:16:15 mike Exp $
2 <%args>
3 @id
4 </%args>
5 <%perl>
6 my $allTargets = (@id == 1 && $id[0] eq "");
7 print "<h2>Testing ...</h2>\n";
8 print "     <ul>\n", join("", map { "      <li>$_\n" } @id), "</ul>\n"
9     if !$allTargets;
10 $m->flush_buffer();
11
12 # Turning on autoflush with $m->autoflush() doesn't seem to work if
13 # even if the "MasonEnableAutoflush" configuration parameter is turned
14 # on in the HTTP configuration, so we donb't even try -- instead,
15 # having ZOOM::IRSpy::Web::log() explicitly calling $m->flush_buffer()
16
17 my $spy = new ZOOM::IRSpy::Web("localhost:3313/IR-Explain---1",
18                                admin => "fruitbat");
19 $spy->targets(@id) if !$allTargets;
20 $spy->initialise();
21 my $res = $spy->check();
22 print "<p>\n";
23 if ($res == 0) {
24     print "<b>All tests were run</b>\n";
25 } else {
26     print "<b>Some tests were skipped</b>\n";
27 }
28 print "</p>\n";
29 </%perl>