]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
New test: distributed broken symlinks cause failure.
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 15 May 2010 13:40:16 +0000 (15:40 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 21 Jun 2010 19:17:40 +0000 (21:17 +0200)
* tests/distlinksbrk.test: New test.
* tests/Makefile.am (TESTS): Updated accordingly.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/distlinksbrk.test [new file with mode: 0755]

index c05f61a6b38fab5d5f5262325301da4b854aabeb..cd301e30baadc2fbb91b23461e51994909eeda91 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-06-21  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       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  <stefano.lattarini@gmail.com>
 
        Modernize, improve and extend tests `suffix*.test'.
index b61e71b43acb8e3359d0a3aea6456765f71172fc..53f989e1b882d51f0412697d00c5e58ac5f9042a 100644 (file)
@@ -278,6 +278,7 @@ distcom6.test \
 distcom7.test \
 distdir.test \
 distlinks.test \
+distlinksbrk.test \
 distname.test \
 dollar.test \
 dollarvar.test \
index 0edcd5be57c2ecfa6331238c482d49ae23d98af4..3e8ff59f4ae24f7fc3794fd412ea0ad308878140 100644 (file)
@@ -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 (executable)
index 0000000..1e478ab
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.
+
+# 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 <<END
+AC_OUTPUT
+END
+
+cat > Makefile.am <<END
+EXTRA_DIST = $lnk1 $lnk2 $lnka $lnkb
+END
+
+ls -l
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+./configure
+
+# Distribution must fail.
+$MAKE distdir && Exit 1
+
+# Names of distributed broken symlinks should be reported in make output.
+$MAKE -k distdir >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
+
+: