85a82602cea22a37371b75beab97ac2718f3f062
[platform/upstream/automake.git] / tests / txinfo20.test
1 #! /bin/sh
2 # Copyright (C) 2003  Free Software Foundation, Inc.
3 #
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 3, or (at your option)
7 # any later version.
8 #
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.
13 #
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/>.
16
17 # Make sure info files survive makeinfo errors.
18
19 required=makeinfo
20 . ./defs || Exit 1
21
22 set -e
23
24 echo AC_OUTPUT >> configure.in
25
26 cat > Makefile.am << 'END'
27 info_TEXINFOS = main.texi sub/main.texi
28 END
29
30 mkdir sub
31
32 cat > main.texi << 'END'
33 \input texinfo
34 @setfilename main
35 @settitle main
36 @node Top
37 Hello walls.
38 @bye
39 END
40
41 cp main.texi sub/main.texi
42
43 $ACLOCAL
44 $AUTOMAKE --add-missing
45 $AUTOCONF
46
47 ./configure
48 $MAKE
49
50 # Feign more info files.
51 : > main-1
52 : > sub/main-1
53
54 # Break main.texi
55 $sleep
56 cp main.texi main.old
57 cat > main.texi << 'END'
58 \input texinfo
59 @setfilename main
60 @settitle main
61 @node Top
62 @unknown_macro{Hello walls.}
63 @bye
64 END
65
66 # makeinfo will bail out, but we should conserve the old info files.
67 $MAKE && Exit 1
68 test -f main
69 test -f main-1
70
71 # Restore main.texi, and break sub/main.texi
72 cp main.texi sub/main.texi
73 mv main.old main.texi
74 $MAKE && Exit 1
75 test -f main
76 test ! -f main-1
77 test -f sub/main
78 test -f sub/main-1