Imported Robodoc.
[robodoc.git] / Source / Test / internalheader_test.pl
1 #!/usr/bin/perl -w
2
3 #****x* SystemTest/internalheader_test
4 # FUNCTION
5 #   Test to see if robodoc handles all the internal
6 #   headers and the options to go with it correctly.
7 #   For this we created a testfile with internal and 
8 #   normal headers.  We generate the documentation for
9 #   it and check if the internal headers show up.
10 # SOURCE
11 #
12
13 use strict;
14 use ROBOTest;
15
16 ROBOTest::start("Internalheader Test");
17
18 # There are 8 internal headers numbered 1 .. 8 in the .dat file
19 my $checksum = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8;
20
21 # We now extract them and compute the sum of all the numbers
22 my %seen = ();
23
24 while (my $line = <>) {
25 # the internal header names end with it_1, it_2, etc, so
26 # we extract these numbers.
27     if ($line =~ m/it_(\d+)</) {
28         $seen{$1}++;
29     }
30 }
31 my $sum = 0;
32 foreach my $key (keys %seen) {
33     $sum += $key;
34 }
35
36 ROBOTest::assert($sum == $checksum);
37 ROBOTest::finish;
38
39 #*******
40