Subject: Re: bug#17512: Valgrind and regression tests?

From: Paul Eggert <[email-masked]>
Date: Fri, 16 May 2014 17:35:46 -0700

behoffski wrote:
>    1. Use a shell alias:
>
>         grep="valgrind --log-file=foo grep" make check

That won't work, as too many parts of the system ignore the aliases.

>    2. Replace grep/egrep/fgrep as appropriate to execute the program
>       within a shell, where valgrind plus any options is incorporated
>       into the program invocation and the logfile is treated
>       appropriately in the program invocation aftermath.

Yes, something like that should work.  You can set up your own 
implementation of grep, like this:

#! /bin/sh
exec valgrind --log-file=foo /full/path/to/actual/grep "$@"

in a shell script called 'grep', in a different directory, and prepand 
that directory to your PATH.

Perhaps Jim has a better way to do it, though -- he's more of a valgrind 
wizard than I.