From: Ralf Wildenhues Date: Wed, 4 Nov 2009 18:42:58 +0000 (+0100) Subject: Coverage for autom4te cache creation issues. X-Git-Tag: v2.65~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bfadd4153ee4743e030f802c2a0f89757adcdd5;p=thirdparty%2Fautoconf.git Coverage for autom4te cache creation issues. * tests/tools.at (autom4te cache creation): New test. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index 639e6942..247f8e0b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-04 Ralf Wildenhues + + Coverage for autom4te cache creation issues. + * tests/tools.at (autom4te cache creation): New test. + 2009-11-03 Ralf Wildenhues Fix testsuite failures with SHELL=zsh. diff --git a/tests/tools.at b/tests/tools.at index 20a0f43b..8a153016 100644 --- a/tests/tools.at +++ b/tests/tools.at @@ -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 # ----------------------