[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Test for temporary files
From: |
Pavel Roskin |
Subject: |
Test for temporary files |
Date: |
Tue, 24 Oct 2000 18:45:25 -0400 (EDT) |
Hello!
As promised, it's the patch for temporary files left by Autoconf macros.
Suggestions on better names are welcome.
Also I must rename files to "expout" due to limitations of AT_CHECK. Maybe
we should have a macro for comparing files.
ChangeLog:
* tests/aclocal.m4 (AC_ENV_SAVE): Renamed to ...
(AC_STATE_SAVE): ... this. Also is saves the list of all files
in the current directory.
* tests/atspecific.m4 (_AT_CHECK_AC_MACRO): Compare lists of
files created by AC_ENV_SAVE. Remove state* before and after
the test.
Regards,
Pavel Roskin
_________________________
Index: tests/aclocal.m4
--- tests/aclocal.m4 Mon Oct 16 08:27:30 2000
+++ tests/aclocal.m4 Tue Oct 24 18:29:10 2000
@@ -10,7 +10,7 @@
[[$2][$1]join([$1], m4_shift(m4_shift($@)))])])
-# AC_ENV_SAVE(FILE)
+# AC_STATE_SAVE(FILE)
# ------------------
# Save the environment, but the variables we are allowed to touch.
# This is to check no test touches the user name space.
@@ -27,7 +27,7 @@
# Some variables some shells use and change
# - POW_LIB
# From acfunctions.m4.
-AC_DEFUN([AC_ENV_SAVE],
+AC_DEFUN([AC_STATE_SAVE],
[(set) 2>&1 |
egrep -v -e \
'join([|],
@@ -46,7 +46,9 @@
[^(_|@|.[*#?].|LINENO|OLDPWD|PIPESTATUS|RANDOM|SECONDS)=])' |
# There maybe variables spread on several lines, eg IFS, remove the dead
# lines
- fgrep = >$1
+ fgrep = >state-env.$1
+ rm -f state-ls.$1
+ ls -1 | grep -v '^state' | sort > state-ls.$1
])
Index: tests/atspecific.m4
--- tests/atspecific.m4 Tue Oct 24 09:56:17 2000
+++ tests/atspecific.m4 Tue Oct 24 18:26:57 2000
@@ -85,12 +85,13 @@
[AC_INIT
AC_CONFIG_AUX_DIR($top_srcdir)
AC_CONFIG_HEADER(config.h:config.hin)
-AC_ENV_SAVE(expout)
+AC_STATE_SAVE(before)
$1
-AC_ENV_SAVE(env-after)
+AC_STATE_SAVE(after)
AC_OUTPUT
])
$2
+rm -f state*
AT_CHECK([autoconf -W none --autoconf-dir .. -l $at_srcdir], 0, [], [])
AT_CHECK([autoheader --autoconf-dir .. -l $at_srcdir], 0, [], [])
AT_CHECK([top_srcdir=$top_srcdir ./configure], 0, ignore, [])
@@ -98,9 +99,14 @@
dnl Some tests might exit prematurely when they find a problem, in
dnl which case `env-after' is probably missing. Don't check it then.
-if test -f env-after; then
- AT_CHECK([cat env-after], 0, expout)
+if test -f state-env.after; then
+ cp -f state-env.before expout
+ AT_CHECK([cat state-env.after], 0, expout)
+ cp -f state-ls.before expout
+ AT_CHECK([cat state-ls.after], 0, expout)
fi
+exit 1
+rm -f state*
])# _AT_CHECK_AC_MACRO
_________________________
- Test for temporary files,
Pavel Roskin <=