Major rewrite to support all-targets search.
[irspy-moved-to-github.git] / web / htdocs / details / check.mc
1 %# $Id: check.mc,v 1.4 2006-09-23 07:13:43 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 my $spy = new ZOOM::IRSpy("localhost:3313/IR-Explain---1",
9                           admin => "fruitbat");
10 print "     <ul>\n", join("", map { "      <li>$_\n" } @id), "</ul>\n"
11     if !$allTargets;
12
13 ZOOM::Log::mask_str("irspy,irspy_test"); # Do we need this?
14 ZOOM::Log::init_level(ZOOM::Log::module_level("irspy,irspy_test"));
15 ZOOM::Log::time_format("%F %T"); # ISO-8601 format
16 ### Arrange to capture logging output ... somehow.
17
18 $spy->targets(@id) if !$allTargets;
19 $spy->initialise();
20 my $res = $spy->check();
21 if ($res == 0) {
22     print "All tests were run\n";
23 } else {
24     print "Some tests were skipped\n";
25 }
26 </%perl>