Merge branch 'yacc-quote-fix'
[automake.git] / tests / rst-formatting.test
blobad80aff87e76e455baf4ad5d6335e9820db7629c
1 #! /bin/sh
2 # Copyright (C) 2012 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
17 # Parallel testsuite harness: check APIs for the registering the
18 # "global test result" in `*.trs' files, as documented in the automake
19 # manual.
21 am_create_testdir=empty
22 . ./defs || Exit 1
24 sed -n '/^am__rst_[a-z_][a-z_]* =/p' "$am_amdir"/check.am > Makefile \
25 || framework_failure_ "fetching definitions from check.am"
27 cat >> Makefile << 'END'
28 test:
29 printf '%s\n' "$$in" | $(am__rst_title) > title-got
30 printf '%s\n' "$$in" | $(am__rst_section) > section-got
31 cat title-exp
32 cat title-got
33 diff title-exp title-got
34 cat section-exp
35 cat section-got
36 diff section-exp section-got
37 END
39 # -------------------------------------------------------------------------
41 cat > title-exp <<'END'
42 ==============
43 ab cd ef
44 ==============
46 END
48 cat > section-exp <<'END'
49 ab cd ef
50 ========
52 END
54 env in='ab cd ef' $MAKE test
56 # -------------------------------------------------------------------------
58 cat > title-exp <<'END'
59 ============================================================================
60 0123456789012345678901234567890123456789012345678901234567890123456789
61 ============================================================================
63 END
65 cat > section-exp <<'END'
66 0123456789012345678901234567890123456789012345678901234567890123456789
67 ======================================================================
69 END
71 in=0123456789012345678901234567890123456789012345678901234567890123456789
72 env in=$in $MAKE test
74 # -------------------------------------------------------------------------
76 cat > title-exp <<'END'
77 =======
79 =======
81 END
83 cat > section-exp <<'END'
87 END
89 env in=x $MAKE test
91 # -------------------------------------------------------------------------