Added options to make Robodoc more customizable.
[robodoc.git] / Source / Test / header_test4.pl
1 #!/usr/bin/perl -w
2
3 use strict;
4 use ROBOTest;
5
6 #****x* SystemTest/header_test4_pl
7 # FUNCTION
8 #   Test if robodoc can handle module and object names with
9 #   spaces in it.  For this we process a file with four
10 #   headers looking something like
11 #      A_Module_TEST/a function test
12 #   Each header has the words A, Module, TEST, a, function, and
13 #   test. They are either separated with spaces or with a '_'.
14 #   ROBODoc should find them all.
15 # SOURCE
16 #
17
18 ROBOTest::start("Names with Spaces Test");
19
20 my $count = 0;
21 while (my $line = <>) {
22     if ( $line =~ m/HEADER_MODULE\s+(\S.*?)$/ ) {
23         my $module = $1;
24         if ( ( $module =~ m/A/ ) and
25              ( $module =~ m/Module/ ) and
26              ( $module =~ m/TEST/ ) ) {
27             $count++;
28         }
29     }
30     if ( $line =~ m/HEADER_FUNCTION_NAME\s+(\S.*?)$/ ) {
31         my $object = $1;
32         if ( ( $object =~ m/a/ ) and
33              ( $object =~ m/function/ ) and
34              ( $object =~ m/test/ ) ) {
35             $count++;
36         }
37         ROBOTest::assert( $object !~ m/\s+$/, "no spaces at end of name" );
38     }
39 }
40
41 # There are 4 valid headers, so the count should be 8
42 ROBOTest::assert( $count == 8, "All 4 headers found" );
43 ROBOTest::finish;
44
45 0;
46
47 #******