automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] New test: distributed broken symlinks cause failure.


From: Stefano Lattarini
Subject: [PATCH] New test: distributed broken symlinks cause failure.
Date: Tue, 13 Apr 2010 15:44:11 +0200
User-agent: KMail/1.12.1 (Linux/2.6.30-2-686; KDE/4.3.2; i686; ; )

At Sunday 04 April 2010, Ralf Wildenhues <address@hidden> 
wrote:
> > > By the way, how is the Automake-generated Makefile expected to
> > >  behave if a file in e.g. EXTRA_DIST is a broken symlink,
> >
> > ... this is still not tested (I don't know what result should be
> > expected in such a situation), and...
> 
> Well, what happens currently?  (I hope 'make dist' fails.)
Yes, it fails, even if with non-optimal diagnostic.  Attached is a 
patch introducing a test that checks for the current semantic.
It works on my Debian system with GNU make 3.81 and 3.76, with 
freebsd-make (from "freebsd-buildutils" package, version 7.2-1)
and with heirloom make and utilities.

Maybe some trick could be devised to improve the current diagnostic, 
but that's not much important IMHO.  An extension to the manual would 
probably be simpler and more useful (sorry, haven't done that yet, I 
could give it a try, but probably not soonish).

Regards,
     Stefano
From 83d0cac3a18c4e398f27b512dbf959806efbe84c Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Tue, 13 Apr 2010 15:27:44 +0200
Subject: [PATCH] New test: distributed broken symlinks cause failure.

* tests/distlinksbrk.test: New test.
* tests/Makefile.am (TESTS): Updated accordingly.
---
 ChangeLog               |    7 +++++
 tests/Makefile.am       |    1 +
 tests/Makefile.in       |    1 +
 tests/distlinksbrk.test |   67 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 76 insertions(+), 0 deletions(-)
 create mode 100755 tests/distlinksbrk.test

diff --git a/ChangeLog b/ChangeLog
index d7f3c23..37d64fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-04-13  Stefano Lattarini  <address@hidden>
+
+       Add a test checking that distributed broken symlinks cause
+       `make dist' to fail.
+       * tests/distlinksbrk.test: New test.
+       * tests/Makefile.am (TESTS): Updated accordingly.
+
 2010-04-11  Ralf Wildenhues  <address@hidden>
 
        Print 'warnings are treated as errors' note if needed.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2255af6..2544d93 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -285,6 +285,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 beb1ac9..d2a7afd 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -525,6 +525,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 0000000..5d15f85
--- /dev/null
+++ b/tests/distlinksbrk.test
@@ -0,0 +1,67 @@
+#! /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 diagnositic.
+
+. ./defs || Exit 1
+
+set -e
+
+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
+
+echo AC_OUTPUT >>configure.in
+
+echo "me = $me" > Makefile.am  # for better failure messages
+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
+grep lnk1 out
+grep lnk2 out
+grep lnka out
+grep lnkb out
-- 
1.6.5


reply via email to

[Prev in Thread] Current Thread [Next in Thread]