Imported Robodoc.
[robodoc.git] / Source / t / pipes.t
1 #/usr/bin/perl -w
2 #vi: spell ff=unix
3 use strict;
4 use warnings;
5 use ROBOTestFrame;
6 use Test::More 'no_plan';
7 use Test::File;
8
9
10 #****h* ROBODoc System Tests/Pipes
11 # FUNCTION
12 #   Test the usage of pipes.
13 #
14 #****
15
16
17 my $pipe_source = <<'EOF';
18 /****f* Test/Test
19  * NAME
20  *   Only "pipes" which match selected output style are picked up.
21  *   |html <CENTER>This will be included in <B>HTML</B> output.</CENTER>
22  *
23  *   |latex \centerline{This will be included in \LaTeX output}
24  *
25  *   Space is mandatory following the pipe marker. The following is not a
26  *   valid pipe marker:
27  *   |html<B>Moi!</B>
28  *
29  *   You should see an equation on the following line:
30  *   |html y = x^2 (sorry, plain HTML is not very powerful)
31  *   |latex \centerline{$y = x^2$}
32  *
33  *   How does this look like?
34  *
35  *   Here comes a multi-line equation array:
36  *    |latex \begin{eqnarray}
37  *    |latex \frac{\partial u}{\partial \tau} & = & D_u {\nabla}^2 u +
38  *    |latex \frac{1}{\epsilon}
39  *    |latex \left ( \hat{u}-{\hat{u}}^2-f\, {v} \, \frac{\hat{u}-q}{\hat{u}+q}
40  *    |latex \right ) \; ,  \label{diffspot:1} \\
41  *    |latex \frac{\partial v}{\partial \tau} & = & \hat{u}-v \; ,
42  *    |latex \label{diffspot:2} \\
43  *    |latex \frac{\partial r}{\partial \tau} & = & D_r {\nabla}^2 r \; .
44  *    |latex \label{diffspAot:3}
45  *    |latex \end{eqnarray}
46  *    |html <I>TODO: write this in html</I>
47  *   Another paragraph
48  * SOURCE
49  */
50     test()
51
52  /******/
53
54 EOF
55
56
57 #****x* Pipes/latex pipes
58 # FUNCTION
59 #   Test the use of latex pipes preformatted more.
60 # |latex $2n < 8$
61 # SOURCE
62 {
63     add_source( "test.c", $pipe_source );
64     mkdocdir();
65     my ( $out, $err ) = runrobo(
66         qw(--src Src 
67            --doc Doc/test
68            --nopre
69            --singledoc
70            --sections
71            --latex
72            ));
73     # expected results:
74     is( $out, '', 'No ouput' );
75     is( $err, '', '... and no error' );
76     file_exists_ok( "Doc/test.tex", 'there should be documentation' );
77     # TODO test content
78     clean();
79 }
80 #****
81
82
83