Imported Robodoc.
[robodoc.git] / Source / t / one_file_per_header.t
1 #!perl
2
3 #------------------------------------------------------------------------------
4 use strict;
5 use warnings;
6 use ROBOTestFrame;
7 use Test::More 'no_plan';
8 use Test::File;
9
10 #****x* Basics/One file per header
11 # FUNCTION
12 #   Test --multidoc with --one_file_per_header for html output.  We
13 #   test this with one source file that contains three headers.  These
14 #   should result in three documentation files.  To make it nasty we
15 #   use some special header names.
16 #
17 # SOURCE
18
19 #    A dummy header to put into dummy source files.
20 my $source = <<'EOF';
21 /****f* Test/Test
22  * NAME
23  *   Test foo bar
24  ******
25  */
26
27 /****f* Test/foo, bar
28  * NAME
29  *   Test foo bar
30  ******
31  */
32
33 /****f* Test/aa::awaw
34  * NAME
35  *   Test foo bar
36  ******
37  */
38
39 EOF
40
41 {
42     add_source( "test.c", $source );
43     my ( $out, $err ) = runrobo(qw(--src Src --doc Doc --one_file_per_header --multidoc --html));
44     # expected results:
45     is( $out, '', 'No ouput' );
46     is( $err, '', '... and no error' );
47     # There are three headers, so there should be three documentation files.
48     file_exists_ok( 'Doc/test_cTest2FTest.html',       'Documentation for Test/Test' );
49     file_exists_ok( 'Doc/test_cTest2Ffoo.html',        'Documentation for Test/foo' );
50     file_exists_ok( 'Doc/test_cTest2Faa3A3Aawaw.html', 'Documentation for Test/aa::awaw' );
51     # And a style sheet.
52     file_exists_ok( "Doc/robodoc.css", 'and a stylesheet' );
53     clean();
54 }
55
56 #*******
57