bug-gnulib
[Top][All Lists]
Advanced

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

Re: valgrind-tests.m4


From: Simon Josefsson
Subject: Re: valgrind-tests.m4
Date: Mon, 17 May 2010 20:21:32 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux)

Ben Pfaff <address@hidden> writes:

> Simon Josefsson <address@hidden> writes:
>
>> I'm running self-tests under valgrind in several projects, and it seems
>> like a general useful thing, so how about putting the macro for this in
>> gnulib?
>
> It looks like this implementation requires rerunning "configure"
> to run tests under valgrind.  If that's right, it seems
> inconvenient.

I don't think that is right -- configure will detect valgrind if
available and setup the variable.  Depending on how the maintainer set
things up, tests will be run under valgrind by default.  To run self
checks without valgrind temporarily, just do 'make check VALGRIND='.
There is no need to rerun configure.

> I've used different approaches in my own projects so that this is not
> required:
>
>         * In GNU PSPP, which mostly uses the built-in Automake
>           test framework, the invocations of the test programs
>           are all through shell scripts.  Each invocation of a
>           test program is preceded by $SUPERVISOR,
>           e.g. "$SUPERVISOR pspp ...".  Then running "make check"
>           runs without valgrind; running "make check
>           SUPERVISOR='libtool --mode=execute valgrind'" runs with
>           valgrind; and so on.  (Sometimes 'libtool
>           --mode=execute gdb --args' is handy.)

I believe that is roughly how my code works, if you replace SUPERVISOR=
with VALGRIND=, and assume that maintainers added $VALGRIND to
TESTS_ENVIRONMENT.

>         * In Open vSwitch, which uses Autotest, I added a
>           "check-valgrind" target that generates a collection of
>           wrapper scripts, one for each program to be tested, and
>           puts them at the head of $PATH, so that the test suite
>           automatically uses valgrind every time it invokes
>           valgrind.

None of the projects I'm thinking of use Autotest, so I need a solution
that doesn't depend on it.

/Simon



reply via email to

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