automake-patches
[Top][All Lists]
Advanced

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

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


From: Stefano Lattarini
Subject: Re: [PATCH] New test: distributed broken symlinks cause failure.
Date: Sun, 20 Jun 2010 22:27:26 +0200
User-agent: KMail/1.12.1 (Linux/2.6.30-2-686; KDE/4.3.4; i686; ; )

At Sunday 20 June 2010, Ralf Wildenhues wrote:
> Thanks.  There is a typo diagnositic in the comments.
Fixed.
 
> The test doesn't look safe for MinGW.  Its 'ln -s' is emulated by
>  'cp -p' which, from looking at the test, will cause a failure not
>  a skip.
Why? The test is skipped if `ln -s NONEXISTING-FILE SYMLINK-NAME' fails,
and this should be the case if `ln -s' is equivalent to `cp -p'.
Am I missing something?

> I'm wondering whether we should be throwing short file name support
>  out of the window completely with Automake; this is an issue for
>  this test because distlinksbrk.test shares >= 8 characters before
>  the dot with distlinks.test; info Autoconf 'File System
>  Conventions' has details.
Apparently, by what I read there, the only systems that might be affected
are:
 1. plain DOS systems, and
 2. Win32 systems with the registry edited to match the old DOS
    behaviour w.r.t. file names (which is a really poor decision if one
    plans to run Posixy software on those Win systems).
Do we still care about these systems?

>  So far we don't have many files which
>  don't adhere to this.  (It's not necessary to limit names to 8
>  characters, but for the one registry setting they should be unique
>  when taking only the first 8, plus the first three of the
>  extension.)  Comments?
Well, apart from my question above, I don't have any truly meaningful
comment or opinion about this matter.  I'll leave the decision to you.

Thanks,
    Stefano
From c7b90b37671efc23d60c502348174f92602590ac Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Sat, 15 May 2010 15:40:16 +0200
Subject: [PATCH] New test: distributed broken symlinks cause failure.

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

diff --git a/ChangeLog b/ChangeLog
index a754652..a13b440 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-06-20  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.
+
        Modernize, improve and extend tests `suffix*.test'.
        * tests/suffix3.test: Enable `errexit' shell flag, and related
        changes.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2771a66..ddb71e1 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -301,6 +301,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 db53cfb..04c73df 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -512,6 +512,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..1e478ab
--- /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 <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
+
+:
-- 
1.6.5


reply via email to

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