[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: autotest/AT_CHECK: ways to pass additional options on to diff?
From: |
Jannick |
Subject: |
RE: autotest/AT_CHECK: ways to pass additional options on to diff? |
Date: |
Thu, 27 Jun 2019 18:34:16 +0200 |
Hi Nick,
On Thu, 25 Apr 2019 23:37:47 +0200, Jannick wrote:
> On Thu, 25 Apr 2019 17:10:11 -0400, Nick Bowler wrote:
> > > simply offer
> > > autotest a customized script called 'diff' - surprise surprise - the
> > > testsuite script finds **first** on PATH.
> >
> > Yes, that sounds workable. You can fairly easily generate such a
> > wrapper script in configure, too, if for portability you need to test
> > whether diff supports some particular option.
Just for the record after some time of diving into things and thinking about
it: here a nice and sweet solution - without anything like diff wrappers or
evil hackery in the autotest scripts - which imply changes the diff command
in the shell environment:
set -a
diff_cmd="$(command -v diff)"
function diff () { "$diff_cmd" --strip-trailing-cr $@ ; }
set +a
make check
unset -f diff # clean-up
Thanks,
J.