libidn-commit
[Top][All Lists]
Advanced

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

[SCM] GNU libidn branch, master, updated. libidn-1-22-26-g19ec674


From: Simon Josefsson
Subject: [SCM] GNU libidn branch, master, updated. libidn-1-22-26-g19ec674
Date: Fri, 25 Nov 2011 08:38:49 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU libidn".

http://git.savannah.gnu.org/cgit/libidn.git/commit/?id=19ec674c4519b618857b7c10ded0839011051e2e

The branch, master has been updated
       via  19ec674c4519b618857b7c10ded0839011051e2e (commit)
      from  bce8393944b396ae3d07da457b68891eb6dbe4f2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 19ec674c4519b618857b7c10ded0839011051e2e
Author: Simon Josefsson <address@hidden>
Date:   Fri Nov 25 09:38:30 2011 +0100

    Fix valgrind.

-----------------------------------------------------------------------

Summary of changes:
 gl/m4/valgrind-tests.m4    |    9 ++++--
 gltests/init.sh            |   59 +++++++++++++++++++++++++++++++++++++++----
 lib/gl/m4/gnulib-common.m4 |    2 +-
 lib/gltests/init.sh        |   59 +++++++++++++++++++++++++++++++++++++++----
 4 files changed, 113 insertions(+), 16 deletions(-)

diff --git a/gl/m4/valgrind-tests.m4 b/gl/m4/valgrind-tests.m4
index ab9e25a..0a2a9a8 100644
--- a/gl/m4/valgrind-tests.m4
+++ b/gl/m4/valgrind-tests.m4
@@ -1,4 +1,4 @@
-# valgrind-tests.m4 serial 2
+# valgrind-tests.m4 serial 3
 dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -21,9 +21,12 @@ AC_DEFUN([gl_VALGRIND_TESTS],
     AC_CHECK_PROGS(VALGRIND, valgrind)
   fi
 
-  if test -n "$VALGRIND" && $VALGRIND -q true > /dev/null 2>&1; then
+  OPTS="-q --error-exitcode=1 --leak-check=full"
+
+  if test -n "$VALGRIND" \
+     && $VALGRIND $OPTS $SHELL -c 'exit 0' > /dev/null 2>&1; then
     opt_valgrind_tests=yes
-    VALGRIND="$VALGRIND -q --error-exitcode=1 --leak-check=full"
+    VALGRIND="$VALGRIND $OPTS"
   else
     opt_valgrind_tests=no
     VALGRIND=
diff --git a/gltests/init.sh b/gltests/init.sh
index c78e5b6..e2f6119 100644
--- a/gltests/init.sh
+++ b/gltests/init.sh
@@ -221,11 +221,45 @@ export MALLOC_PERTURB_
 # a partition, or to undo any other global state changes.
 cleanup_ () { :; }
 
+# Emit a header similar to that from diff -u;  Print the simulated "diff"
+# command so that the order of arguments is clear.  Don't bother with @@ lines.
+emit_diff_u_header_ ()
+{
+  printf '%s\n' "diff -u $*" \
+    "--- $1    1970-01-01" \
+    "+++ $2    1970-01-01"
+}
+
+# Arrange not to let diff or cmp operate on /dev/null,
+# since on some systems (at least OSF/1 5.1), that doesn't work.
+# When there are not two arguments, or no argument is /dev/null, return 2.
+# When one argument is /dev/null and the other is not empty,
+# cat the nonempty file to stderr and return 1.
+# Otherwise, return 0.
+compare_dev_null_ ()
+{
+  test $# = 2 || return 2
+
+  if test "x$1" = x/dev/null; then
+    test -s "$2" || return 0
+    { emit_diff_u_header_ "$@"; sed 's/^/+/' -- "$2"; } >&2
+    return 1
+  fi
+
+  if test "x$2" = x/dev/null; then
+    test -s "$1" || return 0
+    { emit_diff_u_header_ "$@"; sed 's/^/-/' -- "$1"; } >&2
+    return 1
+  fi
+
+  return 2
+}
+
 if diff_out_=`( diff -u "$0" "$0" < /dev/null ) 2>/dev/null`; then
   if test -z "$diff_out_"; then
-    compare () { diff -u "$@"; }
+    compare_ () { diff -u "$@"; }
   else
-    compare ()
+    compare_ ()
     {
       if diff -u "$@" > diff.out; then
         # No differences were found, but Solaris 'diff' produces output
@@ -241,9 +275,9 @@ if diff_out_=`( diff -u "$0" "$0" < /dev/null ) 
2>/dev/null`; then
   fi
 elif diff_out_=`( diff -c "$0" "$0" < /dev/null ) 2>/dev/null`; then
   if test -z "$diff_out_"; then
-    compare () { diff -c "$@"; }
+    compare_ () { diff -c "$@"; }
   else
-    compare ()
+    compare_ ()
     {
       if diff -c "$@" > diff.out; then
         # No differences were found, but AIX and HP-UX 'diff' produce output
@@ -259,11 +293,24 @@ elif diff_out_=`( diff -c "$0" "$0" < /dev/null ) 
2>/dev/null`; then
     }
   fi
 elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
-  compare () { cmp -s "$@"; }
+  compare_ () { cmp -s "$@"; }
 else
-  compare () { cmp "$@"; }
+  compare_ () { cmp "$@"; }
 fi
 
+# Usage: compare EXPECTED ACTUAL
+#
+# Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more.
+# Otherwise, propagate $? to caller: any diffs have already been printed.
+compare ()
+{
+  compare_dev_null_ "$@"
+  case $? in
+    0|1) return $?;;
+    *) compare_ "$@";;
+  esac
+}
+
 # An arbitrary prefix to help distinguish test directories.
 testdir_prefix_ () { printf gt; }
 
diff --git a/lib/gl/m4/gnulib-common.m4 b/lib/gl/m4/gnulib-common.m4
index 3507d45..8621dec 100644
--- a/lib/gl/m4/gnulib-common.m4
+++ b/lib/gl/m4/gnulib-common.m4
@@ -18,7 +18,7 @@ AC_DEFUN([gl_COMMON_BODY], [
 # if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
       || 0x5110 <= __SUNPRO_C)
 #  define _Noreturn __attribute__ ((__noreturn__))
-# elif defined (_MSC_VER) && 1200 <= _MSC_VER
+# elif defined _MSC_VER && 1200 <= _MSC_VER
 #  define _Noreturn __declspec (noreturn)
 # else
 #  define _Noreturn
diff --git a/lib/gltests/init.sh b/lib/gltests/init.sh
index c78e5b6..e2f6119 100644
--- a/lib/gltests/init.sh
+++ b/lib/gltests/init.sh
@@ -221,11 +221,45 @@ export MALLOC_PERTURB_
 # a partition, or to undo any other global state changes.
 cleanup_ () { :; }
 
+# Emit a header similar to that from diff -u;  Print the simulated "diff"
+# command so that the order of arguments is clear.  Don't bother with @@ lines.
+emit_diff_u_header_ ()
+{
+  printf '%s\n' "diff -u $*" \
+    "--- $1    1970-01-01" \
+    "+++ $2    1970-01-01"
+}
+
+# Arrange not to let diff or cmp operate on /dev/null,
+# since on some systems (at least OSF/1 5.1), that doesn't work.
+# When there are not two arguments, or no argument is /dev/null, return 2.
+# When one argument is /dev/null and the other is not empty,
+# cat the nonempty file to stderr and return 1.
+# Otherwise, return 0.
+compare_dev_null_ ()
+{
+  test $# = 2 || return 2
+
+  if test "x$1" = x/dev/null; then
+    test -s "$2" || return 0
+    { emit_diff_u_header_ "$@"; sed 's/^/+/' -- "$2"; } >&2
+    return 1
+  fi
+
+  if test "x$2" = x/dev/null; then
+    test -s "$1" || return 0
+    { emit_diff_u_header_ "$@"; sed 's/^/-/' -- "$1"; } >&2
+    return 1
+  fi
+
+  return 2
+}
+
 if diff_out_=`( diff -u "$0" "$0" < /dev/null ) 2>/dev/null`; then
   if test -z "$diff_out_"; then
-    compare () { diff -u "$@"; }
+    compare_ () { diff -u "$@"; }
   else
-    compare ()
+    compare_ ()
     {
       if diff -u "$@" > diff.out; then
         # No differences were found, but Solaris 'diff' produces output
@@ -241,9 +275,9 @@ if diff_out_=`( diff -u "$0" "$0" < /dev/null ) 
2>/dev/null`; then
   fi
 elif diff_out_=`( diff -c "$0" "$0" < /dev/null ) 2>/dev/null`; then
   if test -z "$diff_out_"; then
-    compare () { diff -c "$@"; }
+    compare_ () { diff -c "$@"; }
   else
-    compare ()
+    compare_ ()
     {
       if diff -c "$@" > diff.out; then
         # No differences were found, but AIX and HP-UX 'diff' produce output
@@ -259,11 +293,24 @@ elif diff_out_=`( diff -c "$0" "$0" < /dev/null ) 
2>/dev/null`; then
     }
   fi
 elif ( cmp --version < /dev/null 2>&1 | grep GNU ) > /dev/null 2>&1; then
-  compare () { cmp -s "$@"; }
+  compare_ () { cmp -s "$@"; }
 else
-  compare () { cmp "$@"; }
+  compare_ () { cmp "$@"; }
 fi
 
+# Usage: compare EXPECTED ACTUAL
+#
+# Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more.
+# Otherwise, propagate $? to caller: any diffs have already been printed.
+compare ()
+{
+  compare_dev_null_ "$@"
+  case $? in
+    0|1) return $?;;
+    *) compare_ "$@";;
+  esac
+}
+
 # An arbitrary prefix to help distinguish test directories.
 testdir_prefix_ () { printf gt; }
 


hooks/post-receive
-- 
GNU libidn



reply via email to

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