autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: 83-cleanup-at-cleanup.patch


From: Akim Demaille
Subject: FYI: 83-cleanup-at-cleanup.patch
Date: 19 Dec 2000 12:34:52 +0100
User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)

I don't think the following message made its way to you.

        Akim

--- Begin Message --- Subject: FYI: 83-cleanup-at-cleanup.patch Date: 18 Dec 2000 12:52:50 +0100 User-agent: Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands)
We have very serious problems with our Internet connection those days
(we reach a peak of +/- 3 kb/s for the whole Epita!), as a result I
don't know (i) when you will receive this message, (ii) when I will be
able to apply these patches.

The main of this patch is cleaning up a bit the test suite, and have
it use AT_CHECK_CONFIGURE since that macro is in charge of registering
the files to clean up, and to dump the log when configure failed.

BTW, the more I think about it, the more I'm tempted to have a unique
list of products files instead of having one per pairs of
SETUP/CLEANUP.  It seems to me that if you remove everything, there
are less risks that you forget something.  In addition that simplifies
testsuite, which is a good thing.

Since no SETUP/CLEANUP can depend upon the state left by the previous
pair, we are not forbidding something which was valid.  The only
difference is that more files will be erased when you run a debug
script: not only those registered for that precise test, so you might
see a file you wanted to keep from another test being removed.  But
that ``feature'' is too weak to be truly usable.  For instance nearly
all the tests produce a configure.in, so keeping half old files, half
new files is no good situation either.  That's an Autoconf-centric
thinking, but I do believe it applies to the other projects too.

As a result, I'd suggest having one and only rm list for the whole
test suite.

        Akim


Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * tests/atgeneral.m4 (AT_CHECK): Make exit status report more
        visible.
        * tests/atspecific.m4 (AT_CHECK_AUTOCONF): Support FLAGS, STDOUT
        and STDERR.
        (AT_CHECK_CONFIGURE): Support plenty, cleanup defs when needed.
        Spread their use in the whole suite.
        Simplify a few AT_CLEANUPs.

Index: tests/atgeneral.m4
--- tests/atgeneral.m4 Fri, 15 Dec 2000 20:41:04 +0100 akim 
(ace/b/19_atgeneral. 1.43 644)
+++ tests/atgeneral.m4 Sun, 17 Dec 2000 10:29:22 +0100 akim 
(ace/b/19_atgeneral. 1.43 644)
@@ -455,7 +455,7 @@ m4_define([AT_CHECK],
   [ignore],
     [   *);;],
     [   m4_default([$2], [0])) ;;
-   *) $at_verbose "Exit code was $at_status, expected $2" >&2
+   *) $at_verbose "$srcdir/AT_LINE: exit code was $at_status, expected $2" >&2
       at_failed=:;;])
 esac
 AS_IFELSE($at_failed, [$5], [$6])
Index: tests/atspecific.m4
--- tests/atspecific.m4 Fri, 15 Dec 2000 20:41:04 +0100 akim 
(ace/b/24_atspecific 1.28 644)
+++ tests/atspecific.m4 Sun, 17 Dec 2000 10:42:19 +0100 akim 
(ace/b/24_atspecific 1.28 644)
@@ -22,11 +22,11 @@
 ## ---------------------------------------- ##


-# AT_CHECK_AUTOCONF
-# -----------------
+# AT_CHECK_AUTOCONF(FLAGS, STDOUT, STDERR)
+# ----------------------------------------
 m4_define([AT_CHECK_AUTOCONF],
 [AT_CLEANUP_FILES(configure)dnl
-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [], [])])
+AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir $1], 0, [$2], [$3])])


 # AT_CHECK_AUTOHEADER
@@ -36,16 +36,20 @@ m4_define([AT_CHECK_AUTOHEADER],
 AT_CHECK([autoheader --autoconf-dir .. -l $at_srcdir], 0, [], [])])


-# AT_CHECK_CONFIGURE
-# ------------------
+# AT_CHECK_CONFIGURE(END-COMMAND,
+#                    [EXIT-STATUS = 0],
+#                    [SDOUT = IGNORE], STDERR)
+# --------------------------------------------
 # `top_srcdir' is needed so that `./configure' finds install-sh.
 # Using --srcdir is more expensive.
 m4_define([AT_CHECK_CONFIGURE],
-[AT_CLEANUP_FILE_IFELSE([config.hin],
-                        [AT_CLEANUP_FILE(config.h)])dnl
+[AT_CLEANUP_FILE_IFELSE([config.hin], [AT_CLEANUP_FILE(config.h)])dnl
+AT_CLEANUP_FILE_IFELSE([defs.in], [AT_CLEANUP_FILE(defs)])dnl
 AT_CLEANUP_FILES(config.log config.status config.cache)dnl
-AT_CHECK([top_srcdir=$top_srcdir ./configure], 0, ignore, [],
-        [test $at_verbose = echo && echo "--- config.log" && cat config.log])])
+AT_CHECK([top_srcdir=$top_srcdir ./configure $1],
+         [$2],
+         m4_default([$3], [ignore]), [$4],
+         [test $at_verbose = echo && echo "$srcdir/AT_LINE: config.log" && cat 
config.log])])


 # _AT_CHECK_AC_MACRO(AC-BODY, PRE-TESTS)
Index: tests/base.at
--- tests/base.at Mon, 27 Nov 2000 22:06:51 +0100 akim (ace/b/29_base.m4 1.15 
644)
+++ tests/base.at Sun, 17 Dec 2000 09:29:43 +0100 akim (ace/b/29_base.m4 1.15 
644)
@@ -40,9 +40,9 @@ AC_DEFUN([TEST3],
 ]])

 AT_CHECK_AUTOCONF
-AT_CHECK([./configure], 0)
+AT_CHECK_CONFIGURE

-AT_CLEANUP(configure)
+AT_CLEANUP



@@ -78,14 +78,14 @@ AC_DEFUN_ONCE([SINGLE_TEST],
 esac
 ]])

-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [],
+AT_CHECK_AUTOCONF([], [],
 [configure.in:16: warning: SINGLE_TEST invoked multiple times
 configure.in:17: warning: SINGLE_TEST invoked multiple times
 ])

-AT_CHECK([./configure], 0)
+AT_CHECK_CONFIGURE

-AT_CLEANUP(configure)
+AT_CLEANUP



@@ -122,13 +122,12 @@ AC_DEFUN_ONCE([SINGLE_TEST],
 esac
 ]])

-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0, [],
+AT_CHECK_AUTOCONF([], [],
 [configure.in:15: warning: SINGLE_TEST invoked multiple times
 ])
-AT_CHECK([./configure], 0)
+AT_CHECK_CONFIGURE

-
-AT_CLEANUP(configure)
+AT_CLEANUP



@@ -155,8 +154,7 @@ AC_DEFUN([INNER_TEST],
 esac
 ]])

-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0)
-AT_CHECK([./configure], 0)
-
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE

 AT_CLEANUP(configure)
Index: tests/compile.at
--- tests/compile.at Fri, 15 Dec 2000 19:32:22 +0100 akim (ace/b/50_compile.at 
1.4 644)
+++ tests/compile.at Fri, 15 Dec 2000 20:44:43 +0100 akim (ace/b/50_compile.at 
1.4 644)
@@ -67,7 +67,7 @@
 #define HAVE_STDIO_H 1
 ])

-AT_CLEANUP(configure config.status config.log config.cache config.hin config.h 
env-after)dnl
+AT_CLEANUP


 ## ------------------------------ ##
@@ -99,7 +99,7 @@
 #define HAVE_STDIO_H 1
 ])

-AT_CLEANUP(configure config.status config.log config.cache config.hin config.h 
env-after)dnl
+AT_CLEANUP



Index: tests/m4sh.at
--- tests/m4sh.at Sat, 02 Dec 2000 12:27:01 +0100 akim (ace/b/44_m4sh.at 1.8 
644)
+++ tests/m4sh.at Sun, 17 Dec 2000 09:18:58 +0100 akim (ace/b/44_m4sh.at 1.8 
644)
@@ -48,7 +48,7 @@
 ]])

 AT_CHECK_AUTOCONF
-AT_CHECK([./configure], 0)
+AT_CHECK_CONFIGURE

 AT_CLEANUP(configure)

@@ -78,7 +78,7 @@
 ]])

 AT_CHECK_AUTOCONF
-AT_CHECK([./configure], 0)
+AT_CHECK_CONFIGURE

 AT_CLEANUP(configure 1 a)

@@ -107,6 +107,6 @@
 ]])

 AT_CHECK_AUTOCONF
-AT_CHECK([./configure], 0)
+AT_CHECK_CONFIGURE

 AT_CLEANUP(configure)
Index: tests/m4sugar.at
--- tests/m4sugar.at Mon, 27 Nov 2000 22:06:51 +0100 akim (ace/b/45_m4sugar.at 
1.6 644)
+++ tests/m4sugar.at Sun, 17 Dec 2000 10:28:56 +0100 akim (ace/b/45_m4sugar.at 
1.6 644)
@@ -12,7 +12,7 @@
 # commas are not swallowed.  This can easily happen because of
 # m4-listification.

-AT_DATA(configure.in,
+AT_DATA([configure.in],
 [[AC_PLAIN_SCRIPT()dnl
 m4_text_wrap([Short string */], [   ], [/* ], 20)

@@ -45,9 +45,9 @@
 First, second , third, [,quoted]
 ]])

-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir -o-], 0, expout)
+AT_CHECK_AUTOCONF([-o-], [expout])

-AT_CLEANUP()
+AT_CLEANUP



@@ -90,4 +90,4 @@
 configure.in:2: the top level
 ])

-AT_CLEANUP()
+AT_CLEANUP
Index: tests/semantics.at
--- tests/semantics.at Fri, 15 Dec 2000 19:32:22 +0100 akim 
(ace/b/25_semantics. 1.29 644)
+++ tests/semantics.at Sun, 17 Dec 2000 10:03:19 +0100 akim 
(ace/b/25_semantics. 1.29 644)
@@ -151,7 +151,7 @@
 AC_OUTPUT
 ]])

-AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0,,
+AT_CHECK_AUTOCONF([], [],
 [configure.in:10: warning: AC_CHECK_TYPE: assuming `uint65536_t' is not a type
 ])
 AT_CHECK([[sed -e '/^#(cut-from-here/,/^#to-here)/!d' -e '/^#/d' configure]],
@@ -164,7 +164,7 @@
 NEW
 ])

-AT_CLEANUP(autoconf.err)
+AT_CLEANUP



@@ -310,7 +310,7 @@ m4_define([AT_CHECK_PROGS_PREPARE],
 _AT_CHECK_AC_MACRO([AC_PATH_XTRA])

 # Check X_DISPLAY_MISSING.
-AT_CHECK([top_srcdir=$top_srcdir ./configure --without-x], 0, ignore)
+AT_CHECK_CONFIGURE([--without-x])
 AT_CHECK_DEFINES(
 [#define X_DISPLAY_MISSING 1
 ])
Index: tests/tools.at
--- tests/tools.at Tue, 12 Dec 2000 20:23:51 +0100 akim (ace/b/30_tools.m4 1.27 
644)
+++ tests/tools.at Sun, 17 Dec 2000 10:04:29 +0100 akim (ace/b/30_tools.m4 1.27 
644)
@@ -273,7 +273,7 @@ AC_DEFUN([TRACE2], [[$2], $1])
 VAL4 iftest1.c
 ], [])

-AT_CLEANUP(configure)
+AT_CLEANUP



@@ -424,7 +424,7 @@ AC_DEFUN([TRACE2], [[$2], $1])
 AT_CHECK([autoupdate --autoconf-dir $top_srcdir], 0, [],
          [autoupdate: `configure.in' is updated
 ])
-AT_CHECK([autoconf --autoconf-dir .. -l $at_srcdir], 0)
+AT_CHECK_AUTOCONF
 AT_CHECK_CONFIGURE
 AT_CHECK([cat src1], 0, [dst1
 ])
Index: tests/torture.at
--- tests/torture.at Tue, 12 Dec 2000 20:23:51 +0100 akim (ace/b/26_torture.m4 
1.22 644)
+++ tests/torture.at Sun, 17 Dec 2000 10:24:38 +0100 akim (ace/b/26_torture.m4 
1.22 644)
@@ -32,26 +32,26 @@
 AT_CHECK_AUTOCONF

 # Create a header
-AT_CHECK([./configure what_to_test=header], 0, ignore)
+AT_CHECK_CONFIGURE([what_to_test=header])
 AT_CHECK([ls header file command link 2>/dev/null], [ignore], [header
 ])

 # Create a file
-AT_CHECK([./configure what_to_test=file], 0, ignore)
+AT_CHECK_CONFIGURE([what_to_test=file])
 AT_CHECK([ls header file command link 2>/dev/null], [ignore], [file
 ])

 # Execute a command
-AT_CHECK([./configure what_to_test=command], 0, ignore)
+AT_CHECK_CONFIGURE([what_to_test=command])
 AT_CHECK([ls header file command link 2>/dev/null], [ignore], [command
 ])

 # Create a link
-AT_CHECK([./configure what_to_test=link], 0, ignore)
+AT_CHECK_CONFIGURE([what_to_test=link])
 AT_CHECK([ls header file command link 2>/dev/null], [ignore], [link
 ])

-AT_CLEANUP(header file link command header.in file.in link.in command.in 
configure config.status)
+AT_CLEANUP(header file link command header.in file.in link.in command.in)



@@ -69,13 +69,13 @@
 ]])

 AT_CHECK_AUTOCONF
-AT_CHECK([./configure], 1, ignore,
+AT_CHECK_CONFIGURE([], [1], [],
 [[config.status: error: cannot find input file: nonexistent.in
 ]])
 # Make sure that the output file doesn't exist
 AT_CHECK([test -f nonexistent], 1)

-AT_CLEANUP(configure config.status config.log config.cache config.h defs)
+AT_CLEANUP



@@ -101,21 +101,21 @@

 AT_CHECK_AUTOCONF

-AT_CHECK([./configure one=one --enable-two=two --with-three=three |
-          sed -n -e 's/^result=//p'], 0,
-         [onetwothree
-], ignore)
-AT_CHECK([./config.status --recheck | sed -n -e 's/^result=//p'], 0,
+AT_CHECK_CONFIGURE([one=one --enable-two=two --with-three=three |
+                     sed -n -e 's/^result=//p'], 0,
+                   [onetwothree
+])
+AT_CHECK([./config.status --recheck | sed -n 's/^result=//p'], 0,
          [onetwothree
-], ignore)
+])

-AT_CHECK([./configure one="\"'$ " --enable-two="\" ' $" --with-three=" \"'$"|
-          sed -n -e 's/^result=//p'], 0,
-         ["'$ " ' $ "'$
-], ignore)
-AT_CHECK([./config.status --recheck | sed -n -e 's/^result=//p'], 0,
+AT_CHECK_CONFIGURE([one="\"'$ " --enable-two="\" ' $" --with-three=" \"'$"|
+                      sed -n -e 's/^result=//p'], 0,
+                   ["'$ " ' $ "'$
+])
+AT_CHECK([./config.status --recheck | sed -n 's/^result=//p'], 0,
          ["'$ " ' $ "'$
-], ignore)
+])

 AT_CLEANUP(configure config.status config.log config.cache)

@@ -130,7 +130,7 @@

 AT_SETUP([#define header templates])

-AT_DATA(configure.in,
+AT_DATA([configure.in],
 [[AC_INIT
 AC_CONFIG_HEADERS(config.h:config.hin)
 # I18n of dummy variables: their French translations.
@@ -150,11 +150,11 @@
 AC_OUTPUT
 ]])

-AT_DATA(defs.in,
+AT_DATA([defs.in],
 address@hidden@
 ]])

-AT_DATA(config.hin,
+AT_DATA([config.hin],
 [[#define foo   0
 #  define bar bar
 #  define baz   "Archimedes was sinking in his baz"
@@ -167,10 +167,10 @@
 #undef aaa
 ]])

-AT_CHECK([../autoconf --autoconf-dir .. -l $at_srcdir], 0)
+AT_CHECK_AUTOCONF
 AT_CHECK_CONFIGURE

-AT_DATA(expout,
+AT_DATA([expout],
 [[/* config.h.  Generated automatically by configure.  */
 #define foo toto
 #  define bar tata
@@ -186,7 +186,7 @@
 AT_CHECK([cat config.h], 0, expout)

 # Check the value of DEFS.  Note the leading space.
-AT_DATA(expout,
+AT_DATA([expout],
 [[ -Dfoo=toto -Dbar=tata -Dbaz=titi -Dfubar=tutu -Da=A -Daaa=AAA -Daa=AA]
 ])

@@ -194,7 +194,7 @@
 # expout, hence nuke the one left by AC_OUTPUT_MAKE_DEFS.
 AT_CHECK([sed -e 's/ $//' defs], 0, expout)

-AT_CLEANUP(configure config.status config.log config.cache config.h defs)
+AT_CLEANUP

--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]