From: Stefano Lattarini Date: Sat, 15 May 2010 13:40:16 +0000 (+0200) Subject: New test: distributed broken symlinks cause failure. X-Git-Tag: v1.11.1b~71^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd50d9c1b5b7057b0fb325d3505a0ae4d975258c;p=thirdparty%2Fautomake.git New test: distributed broken symlinks cause failure. * tests/distlinksbrk.test: New test. * tests/Makefile.am (TESTS): Updated accordingly. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index c05f61a6b..cd301e30b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-06-21 Stefano Lattarini + + Add a test checking that distributed broken symlinks cause + `make dist' to fail. + * tests/distlinksbrk.test: New test. + * tests/Makefile.am (TESTS): Updated. + 2010-06-20 Stefano Lattarini Modernize, improve and extend tests `suffix*.test'. diff --git a/tests/Makefile.am b/tests/Makefile.am index b61e71b43..53f989e1b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -278,6 +278,7 @@ distcom6.test \ distcom7.test \ distdir.test \ distlinks.test \ +distlinksbrk.test \ distname.test \ dollar.test \ dollarvar.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 0edcd5be5..3e8ff59f4 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -516,6 +516,7 @@ distcom6.test \ distcom7.test \ distdir.test \ distlinks.test \ +distlinksbrk.test \ distname.test \ dollar.test \ dollarvar.test \ diff --git a/tests/distlinksbrk.test b/tests/distlinksbrk.test new file mode 100755 index 000000000..1e478aba7 --- /dev/null +++ b/tests/distlinksbrk.test @@ -0,0 +1,78 @@ +#! /bin/sh +# Copyright (C) 2010 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check that distributed broken symlinks cause `make dist' to fail, and +# to do so with (mostly) meaningful diagnostic. + +. ./defs || Exit 1 + +set -e + +# We need, for our broken symlinks, names that make it hard to get false +# positives when grepping make output to look for them. +lnk_base=BrknSymlnk +lnk1=${lnk_base}__001 +lnk2=${lnk_base}__002 +lnka=${lnk_base}__aaa +lnkb=${lnk_base}__bbb + +ln -s nonesuch $lnk1 || { + echo "$me: cannot create broken symlinks" >&2 + Exit 77 +} + +ln -s "`pwd`/nonesuch" $lnk2 + +ln -s $lnk1 $lnka +ln -s $lnka $lnkb + +# Sanity checks. Use `test -r', since Solaris Sh doesn't grok `test -e'. +test ! -r $lnk1 +test ! -r $lnk2 +test ! -r $lnka +test ! -r $lnkb +test -h $lnk1 +test -h $lnk2 +test -h $lnka +test -h $lnkb + +cat >>configure.in < Makefile.am <out 2>&1 || : # don't trust the exit status of make -k +cat out +$FGREP $lnk1 out +$FGREP $lnk2 out +$FGREP $lnka out +$FGREP $lnkb out + +: