]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Use 'diff -u' for regtests if it's supported, its output it much easier to
authorNicholas Nethercote <njn@valgrind.org>
Wed, 25 Feb 2009 04:57:56 +0000 (04:57 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Wed, 25 Feb 2009 04:57:56 +0000 (04:57 +0000)
read than plain 'diff'.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9263

configure.in
tests/vg_regtest.in

index 63fa8e4d08cff8e6fe3b7252ce22989a72c0b69a..ed8fd3fe343c94bd91bff99345dc90d82814262c 100644 (file)
@@ -114,6 +114,23 @@ case "${sed_firstline}" in
 esac
 
 
+# Check if 'diff' supports -u (universal diffs) and use it if possible.
+
+AC_MSG_CHECKING([for diff -u])
+AC_SUBST(DIFF)
+
+# Comparing two identical files results in 0, unless -u isn't supported (as
+# it's not on AIX).
+touch tmp-xxx;
+if diff -u tmp-xxx tmp-xxx ; then
+    AC_MSG_RESULT([yes])
+    DIFF="diff -u"
+else
+    AC_MSG_RESULT([no])
+    DIFF="diff"
+fi
+
+
 # We don't want gcc < 3.0
 AC_MSG_CHECKING([for a supported version of gcc])
 
index 1d397a68965a4b27f3b177c2a51a25cc86db12b2..bee87fc9c996f5eb82dc245c128268ce18aa44ed 100755 (executable)
@@ -277,7 +277,7 @@ sub do_diffs($$$$)
                 ($f_exp eq "/dev/null") or die "Unexpected .exp file: $f_exp\n";
             }
 
-            mysystem("diff $f_exp $name.$mid.out > $name.$mid.diff$n");
+            mysystem("@DIFF@ $f_exp $name.$mid.out > $name.$mid.diff$n");
 
             if (not -s "$name.$mid.diff$n") {
                 # A match;  remove .out and any previously created .diff files.