automake-patches
[Top][All Lists]
Advanced

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

[FYI] {master} tests: avoid spurious failures under "make distcheck"


From: Stefano Lattarini
Subject: [FYI] {master} tests: avoid spurious failures under "make distcheck"
Date: Wed, 22 Feb 2012 13:32:24 +0100

* tests/tap-setup.sh: Pass also '-f' option to 'cp' invocations,
so that files that have already been copied in without write
permissions will still be overwritten where needed, instead of
causing a spurious testsuite failure.  Issue seen when the
testsuite is run under "distcheck".
* tests/defs (get_shell_script): Remove target file before
overwriting it, for the same reason.  Rework code flow a bit
since we are at it.
---
 tests/defs         |    8 +++++---
 tests/tap-setup.sh |    2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/defs b/tests/defs
index 98bc8e1..fd0a8ad 100644
--- a/tests/defs
+++ b/tests/defs
@@ -612,11 +612,13 @@ sed_unindent_prog="" # Avoid interferences from the 
environment.
 # of /bin/sh.
 get_shell_script ()
 {
+  test ! -f "$1" || rm -f "$1" || return 99
   if test x"$am_test_prefer_config_shell" = x"yes"; then
-    sed "1s|#!.*|#! $SHELL|" "$am_scriptdir/$1" > "$1"
-    chmod a+x "$1"
+    sed "1s|#!.*|#! $SHELL|" "$am_scriptdir/$1" > "$1" \
+     && chmod a+x "$1" \
+     || return 99
   else
-    cp "$am_scriptdir/$1" .
+    cp -f "$am_scriptdir/$1" . || return 99
   fi
   sed 10q "$1" # For debugging.
 }
diff --git a/tests/tap-setup.sh b/tests/tap-setup.sh
index ee9d814..6b69a53 100755
--- a/tests/tap-setup.sh
+++ b/tests/tap-setup.sh
@@ -28,7 +28,7 @@ test -f ../defs-static && test -f ../defs \
 test ! -f Makefile.am || mv Makefile.am Makefile.am~ \
   || fatal_ "failed to save Makefile.am"
 
-test -d ../tap-common-setup.dir && cp -Rp ../tap-common-setup.dir/* . \
+test -d ../tap-common-setup.dir && cp -fpR ../tap-common-setup.dir/* . \
   || fatal_ "couldn't get precomputed data files"
 
 fetch_tap_driver
-- 
1.7.9




reply via email to

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