Added options to make Robodoc more customizable.
[robodoc.git] / Source / Test / item_test.pl
1 #!/usr/bin/perl -w
2
3 use ROBOTest;
4
5 ROBOTest::start("Item Test");
6
7 #
8 # In the .dat file there are 43 items numbered from 1 .. 43
9 # The number is located between the words testmark in the item text
10 #
11 my $checksum = 0;
12 foreach my $n (1 .. 43) {
13     $checksum += $n;
14 }
15
16 # We now scan the .res file find the item number, compute the
17 # sum, and see if this is equal to the checksum...
18 my $sum = 0;
19 while (my $line = <>) {
20     if ($line =~ m/<PRE\S+\s+testmark\s+(\d+)\s/) {
21         $sum += $1;
22     }
23 }
24
25 # there should be 43 different items
26 #
27 ROBOTest::assert($sum = $checksum, "Are all items there?");
28 ROBOTest::finish;