70e8f50f2da620e52e752092abebdd1ce4d6a3bc
[irspy-moved-to-github.git] / web / htdocs / details / check.mc
1 %# $Id: check.mc,v 1.13 2006-11-18 00:09:01 mike Exp $
2 <%args>
3 @id
4 $test => "Quick"
5 $really => 0
6 </%args>
7 <%perl>
8 my $allTargets = (@id == 1 && $id[0] eq "");
9 if ($allTargets && !$really) {
10 </%perl>
11      <h2>Warning</h2>
12      <p class="error">
13       Testing all the targets is a very slow process.
14       Are you sure you want to do this?
15      </p>
16      <p>
17       <a href="?really=1">Yes</a>
18       <a href="/">No</a>
19      </p>
20 <%perl>
21 } else {
22
23 print "<h2>Testing ...</h2>\n";
24 print "     <ul>\n", join("", map { "      <li>$_</li>\n" } @id), "</ul>\n"
25     if !$allTargets;
26 $m->flush_buffer();
27
28 # Turning on autoflush with $m->autoflush() doesn't seem to work if
29 # even if the "MasonEnableAutoflush" configuration parameter is turned
30 # on in the HTTP configuration, so we don't even try -- instead,
31 # having ZOOM::IRSpy::Web::log() explicitly calling $m->flush_buffer()
32
33 my $spy = new ZOOM::IRSpy::Web("localhost:3313/IR-Explain---1",
34                                admin => "fruitbat");
35 $spy->log_init_level("irspy,irspy_test");
36 $spy->targets(@id) if !$allTargets;
37 $spy->initialise();
38 my $res = $spy->check($test);
39 print "<p>\n";
40 if ($res == 0) {
41     print "<b>All tests were run</b>\n";
42 } else {
43     print "<b>$res tests were skipped</b>\n";
44 }
45 print "</p>\n";
46 }
47 </%perl>