txinfo-vtexi3.sh 3.5 KB

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