tests: set fail=0 at start
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 19 Dec 2010 03:54:27 +0000 (19:54 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 19 Dec 2010 03:55:00 +0000 (19:55 -0800)
* tests/init.sh (setup_): Move fail=0 initialization here ...
(mktempd_): ... from here, so that tests can rely on fail being
set to 0 initially.  This fixes a problem in coreutils; see:
http://lists.gnu.org/archive/html/coreutils/2010-12/msg00083.html

ChangeLog
tests/init.sh

index 8b02175..1ee355c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-12-18  Paul Eggert  <eggert@cs.ucla.edu>
+
+       tests: set fail=0 at start
+       * tests/init.sh (setup_): Move fail=0 initialization here ...
+       (mktempd_): ... from here, so that tests can rely on fail being
+       set to 0 initially.  This fixes a problem in coreutils; see:
+       http://lists.gnu.org/archive/html/coreutils/2010-12/msg00083.html
+
 2010-12-18  Bruno Haible  <bruno@clisp.org>
 
        memmem-simple: Stylistic changes.
index 14f3b19..4d89a1a 100644 (file)
@@ -324,6 +324,7 @@ setup_()
   fi
 
   initial_cwd_=$PWD
+  fail=0
 
   pfx_=`testdir_prefix_`
   test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
@@ -416,8 +417,6 @@ mktempd_()
   *) fail_ "invalid template: $template_ (must have a suffix of at least 4 X's)";;
   esac
 
-  fail=0
-
   # First, try to use mktemp.
   d=`unset TMPDIR; mktemp -d -t -p "$destdir_" "$template_" 2>/dev/null` \
     || fail=1