]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Coverage for autom4te cache creation issues.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 4 Nov 2009 18:42:58 +0000 (19:42 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 4 Nov 2009 18:42:58 +0000 (19:42 +0100)
* tests/tools.at (autom4te cache creation): New test.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
tests/tools.at

index 639e6942587c7aeebcd0620a322f4f6dfdbbf3c7..247f8e0bb8fcc627f797e2b47d8c6f1633139cd3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-04  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Coverage for autom4te cache creation issues.
+       * tests/tools.at (autom4te cache creation): New test.
+
 2009-11-03  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Fix testsuite failures with SHELL=zsh.
index 20a0f43b3f0e7a3fe7ec221e806dc667f6b1f300..8a153016ca7408707615d54228de777cdbe5183a 100644 (file)
@@ -1167,6 +1167,47 @@ AT_CHECK([test "`find configure -newer newer`" = "" ||
 AT_CLEANUP
 
 
+# autom4te cache creation
+# -----------------------
+# Ensure autom4te fails when it cannot create the cache directory
+# or create files there.
+AT_SETUP([autom4te cache creation])
+
+# Work in a subdirectory so autotest can scribble in the toplevel.
+mkdir sub
+chmod a-w sub
+
+AT_DATA([configure.ac],
+[[AC_INIT
+]])
+
+AT_DATA([.autom4te.cfg],
+[[begin-language: "Autoconf-without-aclocal-m4"
+args: --cache=sub/autom4te.cache
+end-language: "Autoconf-without-aclocal-m4"
+]])
+
+# Do not try this when we are root or on systems without permissions.
+AT_CHECK([: > sub/some-file && exit 77], 1, [ignore], [ignore])
+
+# Failure to create cache directory.
+AT_CHECK_AUTOCONF([], [1], [ignore], [stderr])
+AT_CHECK([grep 'cannot create .*autom4te.cache' stderr], [0], [ignore])
+AT_CHECK([test -f configure], [1])
+
+chmod u+w sub
+AT_CHECK_AUTOCONF
+
+rm -f configure sub/autom4te.cache/*
+chmod a-w sub/autom4te.cache
+
+# Failure to create a file in the cache directory.
+AT_CHECK_AUTOCONF([], [1], [ignore], [stderr])
+AT_CHECK([grep 'cannot open.*autom4te.cache' stderr], [0], [ignore])
+
+AT_CLEANUP
+
+
 # autom4te cache locking
 # ----------------------