* NEWS: Document that m4wrap/m4_wrap might not be LIFO.
[autoconf.git] / tests / tools.at
blob36200f6f973c28c10e59e73e8910f7372175ea8f
1 #                                                       -*- Autotest -*-
3 AT_BANNER([Executables (autoheader, autoupdate...).])
5 # Copyright (C) 2000, 2001, 2003, 2004, 2006 Free Software Foundation, Inc.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 # 02110-1301, USA.
23 ## ----------------------------- ##
24 ## Syntax of the shell scripts.  ##
25 ## ----------------------------- ##
27 # We use `/bin/sh -n script' to check that there are no syntax errors
28 # in the scripts.  Although incredible, there are /bin/sh that go into
29 # endless loops with `-n', e.g., SunOS's:
31 #   $ uname -a
32 #   SunOS ondine 4.1.3 2 sun4m unknown
33 #   $ cat endless.sh
34 #   while false
35 #   do
36 #     :
37 #   done
38 #   exit 0
39 #   $ time sh endless.sh
40 #   sh endless.sh  0,02s user 0,03s system 78% cpu 0,064 total
41 #   $ time sh -nx endless.sh
42 #   ^Csh -nx endless.sh  3,67s user 0,03s system 63% cpu 5,868 total
44 # So before using `/bin/sh -n' to check our scripts, we first check
45 # that `/bin/sh -n' is not broken to death.
47 AT_SETUP([Syntax of the shell scripts])
49 AT_CHECK([test "$ac_cv_sh_n_works" = yes || exit 77])
51 # Specify the absolute name of the tool, as some shells don't honor PATH when
52 # running `sh PROG'.
54 AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/bin/autoconf])
55 AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/tests/autoconf])
56 AT_CHECK_SHELL_SYNTAX([$abs_top_builddir/tests/testsuite])
58 # These are not built, they are in the src tree.
59 AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/install-sh])
60 AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/mkinstalldirs])
61 AT_CHECK_SHELL_SYNTAX([$abs_top_srcdir/config/missing])
63 AT_CLEANUP
68 ## ---------------------------- ##
69 ## Syntax of the Perl scripts.  ##
70 ## ---------------------------- ##
72 AT_SETUP([Syntax of the Perl scripts])
74 AT_CHECK_PERL_SYNTAX([autoheader])
75 AT_CHECK_PERL_SYNTAX([autom4te])
76 AT_CHECK_PERL_SYNTAX([autoreconf])
77 AT_CHECK_PERL_SYNTAX([autoscan])
78 AT_CHECK_PERL_SYNTAX([autoupdate])
79 AT_CHECK_PERL_SYNTAX([ifnames])
81 AT_CLEANUP
86 ## ------------------ ##
87 ## autom4te's cache.  ##
88 ## ------------------ ##
90 AT_SETUP([autom4te cache])
92 AT_DATA_M4SUGAR([[script.4s]],
93 [[m4_include([foo])
94 ]])
96 # Everything is OK.
97 touch foo
98 AT_CHECK_M4SUGAR
100 # We moved a file: it should fail
101 mkdir sub
102 mv foo sub
103 AT_CHECK_M4SUGAR([], [1], [],
104 [m4: script.4s: 1: Cannot open foo: No such file or directory
105 autom4te: m4 failed with exit status: 1
108 # But if we change the main file, then we should no longer complain of
109 # missing files.
110 AT_DATA_M4SUGAR([[script.4s]],
111 [[m4_include([sub/foo])
113 AT_CHECK_M4SUGAR
115 AT_CLEANUP
120 ## ------------------ ##
121 ## autoconf --trace.  ##
122 ## ------------------ ##
125 # autoconf --trace: user macros
126 # -----------------------------
127 AT_SETUP([autoconf --trace: user macros])
129 AT_DATA([configure.ac],
130 [[m4_define([active], [ACTIVE])
131 m4_define([TRACE1], [TRACE2(m4_shift($@))])
132 m4_define([TRACE2], [[$2], $1])
134 # No arguments.
135 TRACE1
136 TRACE2
138 # With arguments, single line.
139 TRACE1(foo, @bar, @baz)
140 TRACE1(foo, TRACE1(bar, baz))
141 TRACE1(foo, active, baz)
142 TRACE1(foo, [active], TRACE1(active, [active]))
144 # With arguments, multiple lines.
145 TRACE1(foo
146 bar,
148 foo)
151 # Several --traces.
152 AT_CHECK_AUTOCONF([-t TRACE1 -t TRACE2], 0,
153 [[configure.ac:6:TRACE1:
154 configure.ac:6:TRACE2:
155 configure.ac:7:TRACE2:
156 configure.ac:10:TRACE1:foo:@bar:@baz
157 configure.ac:10:TRACE2:@bar:@baz
158 configure.ac:11:TRACE1:bar:baz
159 configure.ac:11:TRACE2:baz
160 configure.ac:11:TRACE1:foo::baz
161 configure.ac:11:TRACE2::baz
162 configure.ac:12:TRACE1:foo:ACTIVE:baz
163 configure.ac:12:TRACE2:ACTIVE:baz
164 configure.ac:13:TRACE1:ACTIVE:active
165 configure.ac:13:TRACE2:active
166 configure.ac:13:TRACE1:foo:active::ACTIVE
167 configure.ac:13:TRACE2:active::ACTIVE
168 configure.ac:19:TRACE1:foo bar:bar foo
169 configure.ac:19:TRACE2:bar foo
172 # Several line requests.
173 AT_CHECK_AUTOCONF([[-t TRACE1:'
174 [$1], [$2], [$3].']], 0,
176 [], [], [].
178 [foo], [@bar], [@baz].
180 [bar], [baz], [].
182 [foo], [], [baz].
184 [foo], [ACTIVE], [baz].
186 [ACTIVE], [active], [].
188 [foo], [active], [].
190 [foo
191 bar], [bar
192 foo], [].
195 # ${sep}@.
196 AT_CHECK_AUTOCONF([-t TRACE2:'${)===(}@'], 0,
197 [[[]
199 [@bar])===([@baz]
200 [baz]
201 [])===([baz]
202 [ACTIVE])===([baz]
203 [active]
204 [active])===([])===([ACTIVE]
205 [bar
206 foo]
209 AT_CLEANUP
212 # autoconf --trace: builtins
213 # --------------------------
214 AT_SETUP([autoconf --trace: builtins])
216 AT_DATA([configure.ac],
217 [[define([active], [ACTIVE])
220 AT_CHECK_AUTOCONF([[-t define | sed -n '$p']],
221          0,
222 [[configure.ac:1:define:active:ACTIVE
225 # FIXME: Without `$1' the following test dies.  Groumphf, once again to
226 # dive into obscure feature interaction...
227 # Note that using `-i' means we need the *.m4 files, not the *.m4f files,
228 # hence we need srcdir, not builddir.
229 AT_CHECK_AUTOCONF([[-t define:'$1' -i| sed -n '$p']],
230          0,
231 [[active
234 AT_CLEANUP
238 ## ---------------------------- ##
239 ## autoconf: forbidden tokens.  ##
240 ## ---------------------------- ##
243 # autoconf: forbidden tokens, basic
244 # ---------------------------------
245 AT_SETUP([autoconf: forbidden tokens, basic])
247 AT_DATA_M4SH([configure.ac],
248 [[AS_INIT
249 m4_foo
250 _m4_bar
251 AS_FOO
252 _AS_BAR
253 [dnl]
256 AT_CHECK_AUTOCONF([], 1, [],
257 [[configure.ac:2: error: possibly undefined macro: m4@&t@_foo
258       If this token and others are legitimate, please use m4@&t@_pattern_allow.
259       See the Autoconf documentation.
260 configure.ac:3: error: possibly undefined macro: _m4@&t@_bar
261 configure.ac:4: error: possibly undefined macro: AS@&t@_FOO
262 configure.ac:5: error: possibly undefined macro: _AS@&t@_BAR
263 configure.ac:6: error: possibly undefined macro: d@&t@nl
266 AT_CLEANUP
269 # autoconf: forbidden tokens, exceptions
270 # --------------------------------------
271 AT_SETUP([autoconf: forbidden tokens, exceptions])
273 AT_DATA_M4SH([configure.ac],
274 [[AS_INIT
276 # This is allowed in spite of the name.
277 # It is on purpose that we check the case where there are several
278 # tokens on the same line.
279 m4_pattern_allow([^AS_ALLOWED$])
280 NOT_AS_ALLOWED AS_ALLOWED AS_ALLOWED_NOT
282 # Test forbidding.
283 m4_pattern_forbid([^FORBIDDEN$])
284 NOT_FORBIDDEN FORBIDDEN FORBIDDEN_NOT
286 # Test Autoconf's patterns.
287 AS_THIS_IS_INVALID and _AS_THIS_IS_INVALID_TOO
288 BUT_AZ_THIS_IS_NOT ALTHOUGH_AS_THIS_IS
289 # This is legal, although there is `AS_DEFINE' in there.
290 BAS_DEFINE
291 # AS_THIS_IS_A_COMMENT so just shut up.
292 It would be very bad if Autoconf forgot to expand [AS_]INIT!
295 AT_CHECK_AUTOCONF([], 1, [],
296 [[configure.ac:1: error: possibly undefined macro: AS@&t@_INIT
297       If this token and others are legitimate, please use m4@&t@_pattern_allow.
298       See the Autoconf documentation.
299 configure.ac:7: error: possibly undefined macro: AS@&t@_ALLOWED_NOT
300 configure.ac:10: error: possibly undefined macro: FORBIDDEN
301 configure.ac:14: error: possibly undefined macro: AS@&t@_THIS_IS_INVALID
302 configure.ac:14: error: possibly undefined macro: _AS@&t@_THIS_IS_INVALID_TOO
305 AT_CLEANUP
308 # autoconf: automatically allowed tokens
309 # --------------------------------------
310 AT_SETUP([autoconf: automatically allowed tokens])
312 AT_DATA_M4SH([configure.ac],
313 [[AC_INIT
314 m4_pattern_forbid([^FB_])
315 AC_DEFINE([FB_ONE])
316 AC_SUBST([FB_TWO])
317 AC_OUTPUT
320 AT_CHECK_AUTOCONF
322 AT_CLEANUP
325 # autoconf: subdirectories
326 # --------------------------------------
327 AT_SETUP([autoconf: subdirectories])
329 AT_DATA([configure.ac],
330 [[AC_INIT
331 AC_PROG_MKDIR_P
332 AC_CONFIG_FILES(sub/foo)
333 AC_OUTPUT
336 mkdir sub
338 AT_DATA([sub/foo.in],
339 [[@MKDIR_P@
342 AT_DATA([install-sh])
344 AT_CHECK_AUTOCONF
345 AT_CHECK_CONFIGURE
346 AT_CHECK([[grep '^[^/].*/mkdir -p' sub/foo]], 1)
348 AT_CLEANUP
354 ## --------- ##
355 ## ifnames.  ##
356 ## --------- ##
358 AT_SETUP([ifnames])
360 AT_DATA([iftest1.c],
361 [[#ifdef DEF1
362 #ifndef DEF2
363 #if ! defined DEF3 && defined DEF4 /* but not defined DEF5 */
364     # if SPACES
365         #       if      TABS
366 /* #if C_COMMENTS */
367 // #if CXX_COMMENTS
368 #if LINE1 = \
369 LINE2
370 #if (VAL1*VAL2)==VAL3+VAL4 /* Not VAL5 !!! */
373 AT_DATA([iftest2.c],
374 [[#ifdef IFTEST2
375 #if VAL1
378 AT_CHECK([ifnames iftest1.c iftest2.c], 0,
379 [DEF1 iftest1.c
380 DEF2 iftest1.c
381 DEF3 iftest1.c
382 DEF4 iftest1.c
383 IFTEST2 iftest2.c
384 LINE1 iftest1.c
385 LINE2 iftest1.c
386 SPACES iftest1.c
387 TABS iftest1.c
388 VAL1 iftest1.c iftest2.c
389 VAL2 iftest1.c
390 VAL3 iftest1.c
391 VAL4 iftest1.c
392 ], [])
394 AT_CLEANUP
398 ## ------------ ##
399 ## autoheader.  ##
400 ## ------------ ##
402 # autoheader is intensively used in its modern form throughout this
403 # test suite.  But we also have to check that acconfig.h still works.
404 # autoheader uses autoconf --trace, so traces first.
406 AT_SETUP([autoheader])
408 AT_DATA([acconfig.h],
409 [[/* Define this to whatever you want. */
410 #undef this
414 # 1. Check that `acconfig.h' is still honored.
415 AT_DATA([configure.ac],
416 [[AC_INIT
417 AC_CONFIG_HEADERS(config.h:config.hin)
418 AC_DEFINE(this, "whatever you want.")
421 AT_CHECK_AUTOHEADER([], [], [], [ignore])
422 AT_CHECK([cat config.hin], 0,
423 [[/* config.hin.  Generated from configure.ac by autoheader.  */
424 /* Define this to whatever you want. */
425 #undef this
427 /* Define to the address where bug reports for this package should be sent. */
428 #undef PACKAGE_BUGREPORT
430 /* Define to the full name of this package. */
431 #undef PACKAGE_NAME
433 /* Define to the full name and version of this package. */
434 #undef PACKAGE_STRING
436 /* Define to the one symbol short name of this package. */
437 #undef PACKAGE_TARNAME
439 /* Define to the version of this package. */
440 #undef PACKAGE_VERSION
444 # 2. Check that missing templates are a fatal error.
445 AT_DATA([configure.ac],
446 [[AC_INIT
447 AC_CONFIG_HEADERS(config.h:config.hin)
448 AC_DEFINE(that, "whatever you want.")
451 # The test suite goes too fast for the cache time stamps...
452 # Pass --force.
453 AT_CHECK_AUTOHEADER([--force], [1], [], [ignore])
456 # 3. Check TOP and BOTTOM.
457 AT_DATA([acconfig.h],
458 [[/* Top from acconfig.h. */
459 @TOP@
460 /* Middle from acconfig.h. */
461 @BOTTOM@
462 /* Bottom from acconfig.h. */
465 AT_DATA([configure.ac],
466 [[AC_INIT
467 AC_CONFIG_HEADERS(config.h:config.hin)
468 AH_TOP([Top1 from configure.ac.])
469 AH_TOP([Top2 from configure.ac.])
470 AH_TOP([The Cat in a h@t.])
471 AH_VERBATIM([Middle], [Middle from configure.ac.])
472 AH_VERBATIM([Mouse],  [The Mouse in a h@t.])
473 AH_BOTTOM([Bottom1 from configure.ac.])
474 AH_BOTTOM([Bottom2 from configure.ac.])
475 AH_BOTTOM([The Dog in a h@t.])
477 AC_DEFINE([ANT], [@], [The Ant in a h@t.])
481 # Yes, that's right: the `middle' part of `acconfig.h' is still before
482 # the AH_TOP part.  But so what, you're not supposed to use the two
483 # together.
484 # Ignore STDERR which is the longuish complaint against autoheader junk
485 # files.
486 AT_CHECK_AUTOHEADER([--force], [], [], [ignore])
487 AT_CHECK([cat config.hin], 0,
488 [[/* config.hin.  Generated from configure.ac by autoheader.  */
489 /* Top from acconfig.h. */
490 /* Middle from acconfig.h. */
492 Top1 from configure.ac.
494 Top2 from configure.ac.
496 The Cat in a h@t.
498 /* The Ant in a h@t. */
499 #undef ANT
501 Middle from configure.ac.
503 The Mouse in a h@t.
505 /* Define to the address where bug reports for this package should be sent. */
506 #undef PACKAGE_BUGREPORT
508 /* Define to the full name of this package. */
509 #undef PACKAGE_NAME
511 /* Define to the full name and version of this package. */
512 #undef PACKAGE_STRING
514 /* Define to the one symbol short name of this package. */
515 #undef PACKAGE_TARNAME
517 /* Define to the version of this package. */
518 #undef PACKAGE_VERSION
520 Bottom1 from configure.ac.
522 Bottom2 from configure.ac.
524 The Dog in a h@t.
525 /* Bottom from acconfig.h. */
528 AT_CLEANUP
533 ## ------------ ##
534 ## autoupdate.  ##
535 ## ------------ ##
537 # Check that AC_CANONICAL_SYSTEM and AC_OUTPUT are properly updated.
538 AT_SETUP([autoupdate])
540 AT_DATA([configure.ac],
541 [[AC_INIT(Test, 1.0)
542 AC_CANONICAL_SYSTEM
543 # The doc says 27 is a valid fubar.
544 fubar=27
545 AC_OUTPUT(Makefile, echo $fubar, fubar=$fubar)
548 AT_DATA([expout],
549 [[AC_INIT([Test],[1.0])
550 AC_CANONICAL_TARGET
551 # The doc says 27 is a valid fubar.
552 fubar=27
553 AC_CONFIG_FILES([Makefile])
554 AC_CONFIG_COMMANDS([default],[echo $fubar],[fubar=$fubar])
555 AC_OUTPUT
558 # Checking `autoupdate'.
559 AT_CHECK_AUTOUPDATE
560 AT_CHECK([cat configure.ac], 0, [expout])
561 # Checking that `autoupdate' is idempotent
562 AT_CHECK_AUTOUPDATE
563 AT_CHECK([cat configure.ac], 0, [expout])
565 AT_CLEANUP(configure.ac~)
568 # autoupdating AC_LINK_FILES
569 # --------------------------
570 AT_SETUP([autoupdating AC_LINK_FILES])
572 AT_DATA([configure.ac],
573 [[AC_INIT
574 AC_LINK_FILES(dst1 dst2, src1 src2)
575 AC_OUTPUT
578 AT_DATA([dst1], dst1
580 AT_DATA([dst2], dst2
583 # Checking `autoupdate'.
584 AT_CHECK_AUTOUPDATE([], 0, [], ignore)
585 AT_CHECK_AUTOCONF
586 AT_CHECK_CONFIGURE
587 AT_CHECK([cat src1], 0, [dst1
589 AT_CHECK([cat src2], 0, [dst2
592 AT_CLEANUP(src1 src2 configure.ac~)
595 # autoupdating AC_PREREQ
596 # ----------------------
597 AT_SETUP([autoupdating AC_PREREQ])
599 # Produce `AC_PREREQ(<AUTOUPDATE VERSION>)'.
600 AT_CHECK([autoupdate --version | sed 's/.*) //;q'], 0, [stdout])
601 autoupdate_version=`cat stdout`
602 echo "AC_PREREQ($autoupdate_version)" >expout
604 AT_CHECK([echo "AC_PREREQ(1.0)" | autoupdate -],
605          0, [expout], [])
607 AT_CHECK([echo "AC_PREREQ($autoupdate_version)" | autoupdate -],
608          0, [expout], [])
610 AT_CHECK([echo "AC_PREREQ(999.99)" | autoupdate -],
611          63, [], [ignore])
613 AT_CLEANUP
616 # autoupdating AU_ALIAS
617 # ---------------------
618 AT_SETUP([autoupdating AU_ALIAS])
620 AT_DATA([configure.ac],
621 [[AC_INIT
622 AC_DEFUN([FOO], [$#])
623 AU_ALIAS([BAZ],[FOO])
624 test "FOO:FOO():FOO(x) BAZ:BAZ():BAZ(x)" = "0:1:1 0:1:1" || exit 1
625 AC_PROG_CC
626 AC_STDC_HEADERS
627 AC_OUTPUT
630 # Checking `autoupdate'.
631 AT_CHECK_AUTOUPDATE
632 AT_CHECK_AUTOCONF
633 AT_CHECK_CONFIGURE
634 AT_CHECK([grep 'AC_HEADER_STDC(' configure.ac], 1, [ignore], [ignore])
635 AT_CHECK([grep 'AC_HEADER_STDC' configure.ac], 0, [ignore], [ignore])
637 AT_CLEANUP
640 # autoupdating OLD to NEW
641 # -----------------------
643 # The example taken from the code comments.
644 AT_SETUP([autoupdating OLD to NEW])
646 AT_DATA([aclocal.m4],
647 [[AU_DEFUN([OLD], [NEW([$1, $2], m4@&t@_eval([$1 + $2]))])
648 AC_DEFUN([NEW], [echo "sum($1) = $2"])
651 AT_DATA([configure.ac],
652 [[AC_INIT
653 OLD(1, 2)
654 NEW([0, 0], [0])
657 # Checking `autoupdate'.
658 AT_CHECK_AUTOUPDATE
659 AT_CHECK_AUTOCONF
660 AT_CHECK_CONFIGURE
661 AT_CHECK([[grep 'NEW(\[1, 2], *\[3])' configure.ac]], 0, [ignore], [ignore])
662 AT_CHECK([[grep 'NEW(\[0, 0], *\[0])' configure.ac]], 0, [ignore], [ignore])
664 AT_CLEANUP
667 # autoupdating AC_HELP_STRING
668 # ---------------------------
669 AT_SETUP([autoupdating AC_HELP_STRING])
671 AT_DATA([configure.ac],
672 [[AC_INIT
673 AC_ARG_ENABLE([foo], [AC_HELP_STRING([--enable-foo], [foo bar])], [:], [:])
676 # Checking `autoupdate'.
677 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
678 AT_CHECK_AUTOCONF
679 AT_CHECK_CONFIGURE([], [], [], [ignore])
680 AT_CHECK([[grep '\[--enable-foo], *\[foo bar]' configure.ac]], 0, [ignore], [ignore])
682 AT_CLEANUP
685 # autoupdating with m4sugar
686 # -------------------------
687 AT_SETUP([autoupdating with m4sugar])
689 AT_DATA([aclocal.m4],
690 [[AU_DEFUN([OLD],
691 [m4@&t@_pushdef([foo], [bar])dn@&t@l
692 echo "foo $1 foo"
693 m4@&t@_popdef([foo])dn@&t@l
697 touch foo.in
699 AT_DATA([configure.ac],
700 [[AC_PREREQ(2.54)
701 m4_define([gnumeric_version_epoch], [1])
702 AC_INIT
703 OLD([ bla  bla ])
704 AC_FOREACH([name], [n1 n2],
705            [echo name
707 AC_CHECKING([for feature])
708 AC_MSG_RESULT_UNQUOTED([`echo done`])
710 AC_OUTPUT([foo])
713 # Checking `autoupdate'.
714 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
715 AT_CHECK_AUTOCONF
716 AT_CHECK_CONFIGURE([], [], [], [ignore])
718 AT_CLEANUP
721 # autoupdating AC_LANG_SAVE
722 # -------------------------
723 AT_SETUP([autoupdating AC_LANG_SAVE])
725 AT_DATA([configure.ac],
726 [[AC_INIT
727 AC_LANG_SAVE
728 AC_LANG_RESTORE
729 AC_LANG_SAVE
730 AC_LANG_RESTORE
733 # Checking `autoupdate'.
734 AT_CHECK_AUTOUPDATE([], [], [], [ignore])
735 AT_CHECK_AUTOCONF
736 AT_CHECK_CONFIGURE([], [], [], [ignore])
738 AT_CLEANUP
741 # autoupdating AC_FOREACH
742 # -----------------------
743 AT_SETUP([autoupdating AC_FOREACH])
745 AT_DATA([aclocal.m4],
746 [[AU_DEFUN([OLD], [AC_FOREACH([myvar], [4 5 6], [' myvar'])])
749 AT_DATA([configure.ac],
750 [[AC_INIT
751 echo AC_FOREACH([myvar], [1 2 3], [' myvar'])OLD
754 # Checking `autoupdate'.
755 AT_CHECK_AUTOUPDATE
756 AT_CHECK([[grep 'echo 1 2 3 4 5 6' configure.ac]], 1, [ignore], [ignore])
757 AT_CHECK([[grep 'm4@&t@_foreach_w' configure.ac]], 0, [ignore], [ignore])
758 AT_CHECK_AUTOCONF
759 AT_CHECK_CONFIGURE([], [0], [stdout])
760 AT_CHECK([[grep ' 1 2 3 4 5 6' stdout]], 0, [ignore], [ignore])
762 AT_CLEANUP
765 # autoupdating with aclocal and m4_include
766 # ----------------------------------------
767 AT_SETUP([autoupdating with aclocal and m4@&t@_include])
769 # We use aclocal.
770 AT_CHECK([aclocal --version || exit 77], [], [ignore], [ignore])
772 mkdir m4 aclocal
773 AT_DATA([configure.in],
774 [[AC_INIT(x,0)
775 AC_UNCHANGED_MACRO
776 AC_OLD_MACRO
777 AC_OUTPUT
779 AT_DATA([m4/stuff.m4],
780 [[AU_ALIAS([AC_OLD_MACRO], [AC_NEW_MACRO])
781 AC_DEFUN([AC_NEW_MACRO], [echo hi])
782 AC_DEFUN([AC_UNCHANGED_MACRO], [echo one])
784 cp m4/stuff.m4 aclocal/stuff.m4
785 AT_CHECK([aclocal -I aclocal], [0], [ignore], [ignore])
786 # Checking `autoupdate'.
787 AT_CHECK_AUTOUPDATE
788 AT_CHECK([aclocal -I m4], [0], [ignore], [ignore])
789 AT_CHECK_AUTOUPDATE
791 AT_CLEANUP