6 use Test::More 'no_plan';
9 #****h* ROBODoc System Tests/Header Test
11 # Tests the parsing of ROBODoc headers.
15 #****x* Header Test/Happy Path
17 # Happy Path Simple plain header. This definitely should work
31 add_source( "test.c", $source );
32 my ($out, $err) = runrobo( qw(--src Src --doc Doc --multidoc --test) );
33 is( $out, '', 'no output' );
34 is( $err, '', 'and no error' );
40 #****x* Header Test/Names with Spaces
42 # Try a header name with spaces and some '*' at
43 # the end. The '*' should be ignored.
47 /****f* Test Foo Bar/Name With Spaces ****
56 add_source( "test.c", $source );
57 my ($out, $err) = runrobo( qw(--src Src --doc Doc --multidoc --test) );
58 is( $out, '', 'no output' );
59 is( $err, '', 'and no error' );
60 my $documentation = XMLin( 'Doc/test_c.xml' );
61 my $header = $documentation->{'header'};
62 is ( $header->{'name'}, 'Test Foo Bar/Name With Spaces', 'Header name' );
69 #****x* Header Test/Multiple Names with Spaces
71 # Try several header with names that contain spaces.
72 # These should be accepted.
76 /****f* Test Foo Bar/Name With Spaces, And Anotherone,
86 add_source( "test.c", $source );
87 my ($out, $err) = runrobo( qw(--src Src --doc Doc --multidoc --test) );
88 is( $out, '', 'no output' );
89 is( $err, '', 'and no error' );
90 my $documentation = XMLin( 'Doc/test_c.xml' );
91 my $header = $documentation->{'header'};
92 is ( $header->{'name'}, 'Test Foo Bar/Name With Spaces', 'Header name' );
99 #****x* Header Test/Broken header
101 # Try several header with names that contain spaces.
102 # These should be accepted.
105 my $source = <<'EOF';
106 {****f* xxxxxx/x_xxx_xxxxxxxxxxxxxxxxxxxxxxxx
109 *xxxx xxxxxxx xxxxxxxxx xxxxxxxxxx xxxxxxx xxxxxxxxxxxx xx xx
111 *xxxxxxxxx x_xxx_xxxxxxxxxxxxxxxxxx xxxxxxx
114 *xxxxxxx : xxx xxxxxxx xxxx xxxxxx xxxxxxxxx xxxxxxxxxxxx xxxxx xx xxx
116 * xxxxxxxxx xxxxxxxxx xxxxx xxxxxxxxxxxx.
117 *xxxxxxxxxxx : xxx xxxxxxxxx xxxxx xxxxx xxx xx xxxxx xxxxxx xx xxxxxxxxxx
118 * xxxxxxxxx xxxxxxxx xx
120 *xxxx__xxxxxxx, x_xxx_xxxxxxxxx, xxxx__xxxxxxxx, x_xxx_xxxxxxxx,
121 *x_xxx_xxxxxxxxx, x_xxx_xxxxxxxxxxxxxx xx x_xxxx_xxxxxx_xxx
125 *x_xxx_xxxxxxxxxxxxxxxxxxxxxxxx (xxxxxxx := 5000,
126 * xxxxxxxxxxx := xx_xxxxxxxxxxx);
134 my $config = <<'EOF';
172 h "Modules" vptlib_modules
173 f "Functies" vptlib_functies
174 v "Variabelen" vptlib_variabelen
175 s "Structuren" vptlib_structuren
176 e "Enumeraties" vptlib_enumeraties
177 c "Constanten" vptlib_constanten
178 u "Unittesten" vptlib_unittesten
179 t "Typedefinities" vptlib_typedefs
180 m "Macros" vptlib_macros
181 d "Definities" vptlib_definities
184 --documenttitle "Xxxxxxxxxxxxxxxxxxx"
209 remark begin markers:
217 source line comments:
223 add_source( "test.c", $source );
224 add_configuration( "test.rc", $config );
225 my ($out, $err) = runrobo( qw(--src Src --doc Doc --rc Config/test.rc --test) );
226 is( $out, '', 'no output' );
227 is( $err, '', 'and no error' );
236 #****x* Header Test/Circular header
238 # The 3rd header points to the first header,
239 # completing a circle. ROBODoc should complain
244 local $TODO = "checking circular headers is not implemented yet.";
245 my $source = <<'EOF';
263 add_source( "test.c", $source );
264 my ($out, $err) = runrobo( qw(
272 # ROBODoc should complain about circular
274 isnt( $err, '', 'there should be an error' );