tests: Let 'ltorder.sh' run successfully with Guix dynamic loader
[automake.git] / t / txinfo-makeinfo-error-no-clobber.sh
blobbcb1a7172051e3f3b0081121a39b91b648e1d485
1 #! /bin/sh
2 # Copyright (C) 2003-2018 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 <https://www.gnu.org/licenses/>.
17 # Make sure info files survive makeinfo errors.
19 required=makeinfo
20 . test-init.sh
22 echo AC_OUTPUT >> configure.ac
24 cat > Makefile.am << 'END'
25 info_TEXINFOS = main.texi sub/main.texi
26 END
28 mkdir sub
30 cat > main.texi << 'END'
31 \input texinfo
32 @setfilename main.info
33 @settitle main
34 @node Top
35 Hello walls.
36 @bye
37 END
39 cp main.texi sub/main.texi
41 $ACLOCAL
42 $AUTOMAKE --add-missing
43 $AUTOCONF
45 ./configure
46 $MAKE
48 # Feign more info files.
49 : > main.info-1
50 : > sub/main.info-1
52 # Break main.texi.
53 $sleep
54 cp main.texi main.old
55 cat > main.texi << 'END'
56 \input texinfo
57 @setfilename main.info
58 @settitle main
59 @node Top
60 @unknown_macro{Hello walls.}
61 @bye
62 END
64 # makeinfo will bail out, but we should conserve the old info files.
65 $MAKE && exit 1
66 test -f main.info
67 test -f main.info-1
69 # Restore main.texi, and break sub/main.texi.
70 cp main.texi sub/main.texi
71 mv main.old main.texi
72 $MAKE && exit 1
73 test -f main.info
74 test ! -e main.info-1
75 test -f sub/main.info
76 test -f sub/main.info-1