ac-output-old.tap 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. #!/bin/sh
  2. # Copyright (C) 1996-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. # Test for various older bugs related to quoting, escaping and
  17. # line breaking in the use of AC_OUTPUT. Synthesised by a bunch
  18. # of older tests (referenced below).
  19. . test-init.sh
  20. plan_ 22
  21. rm -f configure.ac depcomp # Not required.
  22. # -----------------------------------------------------------------------
  23. # Test for bug reported by François Pinard.
  24. # If \ is in AC_OUTPUT, automake barfs.
  25. # This was the old test 'acoutbs.test'.
  26. # Also test for bug reported by David A. Swierczek.
  27. # Another bug with \ in AC_OUTPUT (this time with whitespace).
  28. # This was the old test 'acoutbs2.test'.
  29. acoutbs_check ()
  30. {
  31. dir=acoutbs$1
  32. mkdir $dir
  33. cd $dir
  34. cat > configure.ac
  35. touch Makefile.am zot.in
  36. command_ok_ "aclocal groks '\\' in AC_OUTPUT ($dir)" $ACLOCAL
  37. command_ok_ "automake groks '\\' in AC_OUTPUT ($dir)" $AUTOMAKE
  38. command_ok_ "autoconf groks '\\' in AC_OUTPUT ($dir)" $AUTOCONF
  39. command_ok_ "can ./configure in $dir" ./configure
  40. command_ok_ "zot created in $dir" test -f zot
  41. ls -a > lst || bailout_ "cannot get file listing in $dir"
  42. command_ok_ "'\\' not leaked in filenames in $dir" not grep '\\' lst
  43. cd ..
  44. }
  45. acoutbs_check 1 << 'END'
  46. AC_INIT([acoutbs1], [1.0])
  47. AM_INIT_AUTOMAKE
  48. AC_OUTPUT(Makefile \
  49. zot)
  50. END
  51. acoutbs_check 2 << 'END'
  52. AC_INIT([acoutbs2], [1.0])
  53. AM_INIT_AUTOMAKE
  54. AC_OUTPUT(\
  55. Makefile \
  56. zot
  57. )
  58. END
  59. # -----------------------------------------------------------------------
  60. # Test for bug reported by Jerome Santini.
  61. # If I put this line in my configure.ac:
  62. # AC_OUTPUT(Makefile src/Makefile tests/Makefile, echo timestamp > stamp-h)dnl
  63. # automake is not happy:
  64. # [ ... ]
  65. # This was the old test 'acoutnoq.test'.
  66. mkdir acoutnoq
  67. cd acoutnoq
  68. cat > configure.ac << 'END'
  69. AC_INIT([acoutnoq], [1.0])
  70. AM_INIT_AUTOMAKE
  71. AC_OUTPUT(Makefile, [true])
  72. END
  73. : > Makefile.am
  74. command_ok_ "aclocal and quoted AC_OUTPUT second argument" $ACLOCAL
  75. command_ok_ "automake and quoted AC_OUTPUT second argument" $AUTOMAKE
  76. cd ..
  77. # -----------------------------------------------------------------------
  78. # Test for bug when AC_OUTPUT has 2 args on the same line, eg:
  79. # AC_OUTPUT([Makefile automake tests/Makefile],[chmod +x automake])
  80. # This was the old test 'acoutpt.test'.
  81. mkdir acoutpt
  82. cd acoutpt
  83. cat > configure.ac << 'END'
  84. AC_INIT([acoutpt], [1.0])
  85. AM_INIT_AUTOMAKE
  86. AC_OUTPUT([Makefile], [true])
  87. END
  88. : > Makefile.am
  89. command_ok_ "aclocal and two AC_OUTPUT arguments on same line" $ACLOCAL
  90. command_ok_ "automake and two AC_OUTPUT arguments on same line" $AUTOMAKE
  91. cd ..
  92. # -----------------------------------------------------------------------
  93. # Test for bug reported by Eric Magnien.
  94. # This was the old test 'acoutpt2.test'.
  95. mkdir acoutpt2
  96. cd acoutpt2
  97. # Name of the current "subtest".
  98. cur=acoutput2
  99. cat > configure.ac <<END
  100. AC_INIT([$cur], [1.0])
  101. AM_INIT_AUTOMAKE
  102. AC_OUTPUT([subdir/Makefile subdir/foo Makefile foo], [true])
  103. END
  104. mkdir subdir
  105. : > Makefile.am
  106. : > subdir/Makefile.am
  107. : > foo.in
  108. : > subdir/foo.in
  109. command_ok_ "aclocal and AC_OUTPUT ($cur)" $ACLOCAL
  110. command_ok_ "automake and AC_OUTPUT ($cur)" $AUTOMAKE
  111. command_ok_ "foo.in mentioned two times in Makefile.in ($cur)" \
  112. test $($FGREP -c 'foo.in' Makefile.in) -eq 2
  113. # This ought to work as well.
  114. command_ok_ "'automake -a -f' and AC_OUTPUT ($cur)" \
  115. $AUTOMAKE --add-missing --force-missing
  116. cd ..
  117. # -----------------------------------------------------------------------
  118. # Test for bug reported by François Pinard.
  119. # This was the old test 'acoutqnl.test'.
  120. mkdir acoutqnl
  121. cd acoutqnl
  122. cat > configure.ac << 'END'
  123. AC_INIT([acoutqnl], [1.0])
  124. AM_INIT_AUTOMAKE
  125. AC_OUTPUT([Makefile],
  126. [echo zardoz has spoken])
  127. END
  128. : > Makefile.am
  129. command_ok_ "aclocal and two AC_OUTPUT arguments on two lines" $ACLOCAL
  130. command_ok_ "automake and two AC_OUTPUT arguments on two lines" $AUTOMAKE
  131. cd ..
  132. # -----------------------------------------------------------------------
  133. # And we're done.
  134. exit 0