doc: typos in test file.
[automake.git] / t / txinfo-vtexi3.sh
blob23f32904beafd258dac7b7a5c42b2e17573689d6
1 #! /bin/sh
2 # Copyright (C) 2011-2024 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 # Check that vers*.texi files are automatically created and distributed
18 # if @included into a texi source. Also check that they correctly contain
19 # the @values definitions they are advertised to.
20 # See also the related test 'txinfo-vtexi4.sh', which does similar checks,
21 # but for version.texi only, and requires makeinfo, tex and texi2dvi.
23 . test-init.sh
25 # We are going to override package version in AC_INIT, so we need
26 # to redefine the name of the distdir as well.
27 distdir=$me-7.45.3a
29 # This should work without tex, texinfo or makeinfo.
30 TEX=false TEXI2DVI=false MAKEINFO=false
31 export TEX TEXI2DVI MAKEINFO
33 cat > configure.ac << END
34 AC_INIT([$me], [7.45.3a])
35 AM_INIT_AUTOMAKE
36 AC_CONFIG_FILES([Makefile])
37 AC_OUTPUT
38 END
40 cat > Makefile.am << 'END'
41 info_TEXINFOS = foobar.texi quux.texi zardoz.texi
42 .PHONY: echo-distfiles
43 echo-distfiles:
44 @echo ' ' $(DISTFILES) ' '
45 END
47 cat > foobar.texi << 'END'
48 @setfilename foobar.info
49 random text
50 @include version.texi
51 END
53 cat > quux.texi << 'END'
54 @setfilename quux.info
55 @include version-quux.texi
56 random text
57 END
59 cat > zardoz.texi << 'END'
60 @setfilename zardoz.info
61 some random text
62 @include vers1a_2b.texi
63 more random text
64 END
66 # Required when using Texinfo.
67 : > texinfo.tex
68 cp "$am_scriptdir"/mdate-sh .
70 $ACLOCAL
71 $AUTOCONF
72 $AUTOMAKE
74 day='([1-9]|1[0-9]|2[0-9]|3[01])'
75 month='(January|February|March|April|May|June|July|August|September|October|November|December)'
76 year='20[0-9][0-9]' # Hopefully automake will be obsolete in 80 years ;-)
77 date="$day $month $year"
79 do_check ()
81 # Basename of the vers*.texi file.
82 vfile=$1
83 # The $(srcdir) of the current build.
84 srcdir=$2
85 # The vers*.texi file must be created in $(srcdir).
86 $MAKE $srcdir/$vfile.texi
87 cat $srcdir/$vfile.texi
88 # EDITION and VERSION are synonyms, as per documentation.
89 grep "^@set EDITION 7\\.45\\.3a$" $srcdir/$vfile.texi
90 grep "^@set VERSION 7\\.45\\.3a$" $srcdir/$vfile.texi
91 # Check that UPDATED seems right, and that UPDATED and UPDATED-MONTH
92 # are consistent.
93 $EGREP "^@set UPDATED $date$" $srcdir/$vfile.texi
94 vmonth=$(grep '^@set UPDATED ' $srcdir/$vfile.texi | awk '{print $4, $5}')
95 grep "^@set UPDATED-MONTH $vmonth$" $srcdir/$vfile.texi
96 # Check that the vers*.texi file is distributed according
97 # to $(DISTFILES).
98 $MAKE echo-distfiles # For debugging.
99 $MAKE -s echo-distfiles | grep "[ /]$vfile\\.texi"
102 mkdir build
103 cd build
104 ../configure
106 do_check version ..
107 do_check version-quux ..
108 do_check vers1a_2b ..
110 # The various $(srcdir)/*.info are required for the distribution
111 # and they must be newer than version.texi, so that make won't try
112 # to rebuild them.
113 $sleep
114 touch ../foobar.info
115 touch ../quux.info
116 touch ../zardoz.info
117 # Check that the vers*.texi files are really distributed.
118 $MAKE distdir
119 ls -l $distdir
120 diff ../version.texi $distdir/version.texi
121 diff ../version-quux.texi $distdir/version-quux.texi
122 diff ../version.texi $distdir/vers1a_2b.texi