From 95f49af2f25d8184c3325679b8e65140f99a77ba Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 25 Feb 2009 04:57:56 +0000 Subject: [PATCH] Use 'diff -u' for regtests if it's supported, its output it much easier to read than plain 'diff'. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9263 --- configure.in | 17 +++++++++++++++++ tests/vg_regtest.in | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 63fa8e4d08..ed8fd3fe34 100644 --- a/configure.in +++ b/configure.in @@ -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]) diff --git a/tests/vg_regtest.in b/tests/vg_regtest.in index 1d397a6896..bee87fc9c9 100755 --- a/tests/vg_regtest.in +++ b/tests/vg_regtest.in @@ -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. -- 2.47.3